Skip to content

Commit

Permalink
Switch from MSBuild to Ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarditi committed Nov 27, 2023
1 parent 93a55bd commit 0f4418c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 27 deletions.
12 changes: 0 additions & 12 deletions test_scripts/automation/Windows/config-vars.bat
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,6 @@ if not defined CLANG_COMMIT (
set CLANG_COMMIT=HEAD
)

if NOT DEFINED MSBUILD_BIN (
@rem used to be: set "MSBUILD_BIN=%programfiles(x86)%\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_BIN=%programfiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe"
)

if NOT DEFINED MSBUILD_CPU_COUNT (
if DEFINED NUMBER_OF_PROCESSORS (
set MSBUILD_CPU_COUNT=%NUMBER_OF_PROCESSORS%
Expand All @@ -189,11 +184,6 @@ if NOT DEFINED MSBUILD_CPU_COUNT (
)
)

if NOT DEFINED CL_CPU_COUNT (
rem It would be better to calculate this based on total physical memory availablity.
set CL_CPU_COUNT=4
)

echo Configured environment variables:
echo.
echo. BUILDCONFIGURATION: %BUILDCONFIGURATION%
Expand All @@ -217,8 +207,6 @@ echo. CHECKEDC BRANCH: %CHECKEDC_BRANCH%
echo. CHECKEDC_COMMIT: %CHECKEDC_COMMIT%
echo. SIGN_BRANCH: %SIGN_BRANCH%
echo.
echo. MSBUILD_BIN: %MSBUILD_BIN%
echo. MSBUILD_CPU_COUNT: %MSBUILD_CPU_COUNT%
echo. CL_CPU_COUNT: %CL_CPU_COUNT%

exit /b 0
12 changes: 1 addition & 11 deletions test_scripts/automation/Windows/run-cmake.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
rem Create directories and sync files

if "%TEST_TARGET_ARCH%"=="AMD64" (
set CMAKE_GENERATOR=-G "Visual Studio 17 2022"
) else (
rem There is intentionally a blank space after the equal here, to force this to be
rem an empty string.
set CMAKE_GENERATOR=
)

if "%BUILD_PACKAGE%"=="Yes" (
if "%BUILDCONFIGURATION%"=="Release" (
set EXTRA_FLAGS="-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON -DLLVM_USE_CRT_RELEASE=MT"
Expand All @@ -21,9 +13,7 @@ if "%BUILD_PACKAGE%"=="Yes" (
set OLD_DIR=%CD%

cd %LLVM_OBJ_DIR%
rem This generates a build system that supports multiple configurations. Don't try setting CMAKE_BUILD_TYPE here
rem because it is ignored.
cmake %CMAKE_GENERATOR% -T "host=x64" %EXTRA_FLAGS% -DLLVM_ENABLE_PROJECTS=clang -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm
cmake -G Ninja %EXTRA_FLAGS% -DCMAKE_BUILD_TYPE=%BUILDCONFIGURATION% DLLVM_ENABLE_PROJECTS=clang -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON %BUILD_SOURCESDIRECTORY%\checkedc-llvm-project\llvm
if ERRORLEVEL 1 (goto cmdfailed)

:succeeded
Expand Down
7 changes: 3 additions & 4 deletions test_scripts/automation/Windows/test-clang.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ cd %LLVM_OBJ_DIR%
if "%SKIP_CHECKEDC_TESTS%"=="Yes" (
rem
) else (
"%MSBUILD_BIN%" projects\checkedc-wrapper\check-checkedc.vcxproj /p:Configuration=%BUILDCONFIGURATION% /v:%MSBUILD_VERBOSITY% /maxcpucount:%MSBUILD_CPU_COUNT% /p:CL_MPCount=%CL_CPU_COUNT%
ninja -j %MSBUILD_CPU_COUNT% check-checkedc
if ERRORLEVEL 1 (goto cmdfailed)
)

if "%TEST_SUITE%"=="CheckedC" (
rem
) else if "%TEST_SUITE%"=="CheckedC_clang" (
"%MSBUILD_BIN%" tools\clang\test\check-clang.vcxproj /p:Configuration=%BUILDCONFIGURATION% /v:%MSBUILD_VERBOSITY% /maxcpucount:%MSBUILD_CPU_COUNT% /p:CL_MPCount=%CL_CPU_COUNT%
if ERRORLEVEL 1 (goto cmdfailed)
ninja -j %MSBUILD_CPU_COUNT% check-clang
) else if "%TEST_SUITE%"=="CheckedC_LLVM" (
"%MSBUILD_BIN%" check-all.vcxproj /p:Configuration=%BUILDCONFIGURATION% /v:%MSBUILD_VERBOSITY% /maxcpucount:%MSBUILD_CPU_COUNT% /p:CL_MPCount=%CL_CPU_COUNT%
ninja -j %MSBUILD_CPU_COUNT% check-all
if ERRORLEVEL 1 (goto cmdfailed)
)

Expand Down

0 comments on commit 0f4418c

Please sign in to comment.