Add Windows build with clang

This commit is contained in:
2026-02-23 16:29:49 +01:00
parent f1f11ecf9b
commit 0fda0d75fb
4 changed files with 67 additions and 9 deletions

15
namecollision/build.ps1 Normal file
View File

@@ -0,0 +1,15 @@
param(
[string]$Opt = "-O0"
)
$ErrorActionPreference = "Stop"
# Compile hello.cpp as a shared library (also generates libhello.lib import library)
clang++ -std=c++17 $Opt -shared -o libhello.dll hello.cpp "-Wl,/IMPLIB:libhello.lib"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Compile and link main.cpp with the shared library
clang++ -std=c++17 $Opt -o main.exe main.cpp libhello.lib
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
Write-Host "Build successful"