mirror of
https://github.com/ElliotKillick/windows-vs-linux-loader-architecture
synced 2026-06-08 10:57:32 +00:00
19 lines
981 B
Batchfile
Executable File
19 lines
981 B
Batchfile
Executable File
@echo off
|
|
|
|
rem These options replicate Visual Studio
|
|
rem /MD: Use UCRT instead of statically linking CRT into modules
|
|
rem /INCREMENTAL:NO: Remove "ILT" from symbol names
|
|
rem Exclude debug flags for performance test
|
|
cl dll-test.c /DUNICODE /D_UNICODE /MD /LD /link /INCREMENTAL:NO
|
|
cl thread-test.c dll-test.lib /DUNICODE /D_UNICODE /MD /link /INCREMENTAL:NO
|
|
|
|
rem Helper: If compilation fails because cl command doesn't exist then re-run in the correct environment
|
|
if %ERRORLEVEL% equ 9009 (
|
|
echo Compiler not found. Opening Visual Studio developer environment...
|
|
set "VSCMD_START_DIR=%cd%"
|
|
set "VSCMD_SKIP_SENDTELEMETRY=1"
|
|
rem Find the latest x64 Developer CMD version then open it
|
|
rem ^&: Inject running our build script after Visual Studio script (bug -> feature)
|
|
for /f "delims=" %%f in ('dir /b /s /A-D /O-N "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\x64 Native Tools Command Prompt for VS *.lnk"') do start "" "%%f" ^& build.bat & goto :EOF
|
|
)
|