Files
strangecpp/namecollision/build.ps1
2026-02-23 16:31:53 +01:00

16 lines
476 B
PowerShell

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"