Files
test/build_files/windows/configure_ninja.cmd
Anthony Roberts d29ef95c3c Windows: Rework clang scripts, and enable by default on Windows ARM64
This switches clang to be the default compiler on Windows ARM64, allowing for an override to MSVC.

Turns out MSVC builds have been broken for months, but nobody checked, so I'm just switching them off for now and setting clang as the default.

These updated scripts allow for the msbuild generator to use an external (ie, non-MSVC) clang installation properly, otherwise they failed.

They also allow for users to specify their own desired clang compiler via an environment variable.

An update to the docs will come seperately.

Pull Request: https://projects.blender.org/blender/blender/pulls/134566
2025-02-20 11:23:01 +01:00

66 lines
1.6 KiB
Batchfile

ninja --version 1>NUL 2>&1
if %ERRORLEVEL% NEQ 0 (
echo "Ninja not detected in the path"
exit /b 1
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%BUILD_WITH_SCCACHE%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_WINDOWS_SCCACHE=On
if NOT "%verbose%" == "" (
echo Enabling sccache
)
)
if "%WITH_CLANG%" == "1" (
REM We want to use an external manifest with Clang
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_WINDOWS_EXTERNAL_MANIFEST=On
REM We can assume that we have a working copy via find_llvm.cmd
set CC=%LLVM_DIR%\bin\clang-cl
set CXX=%LLVM_DIR%\bin\clang-cl
set CFLAGS=-m64
set CXXFLAGS=-m64
)
if "%WITH_ASAN%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_COMPILER_ASAN=On
)
if NOT "%verbose%" == "" (
echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
)
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
)
if "%MUST_CLEAN%"=="1" (
echo Cleaning %BUILD_DIR%
cd %BUILD_DIR%
"%CMAKE%" --build . --config Clean
)
if NOT EXIST %BUILD_DIR%\build.ninja set MUST_CONFIGURE=1
if "%NOBUILD%"=="1" set MUST_CONFIGURE=1
if "%MUST_CONFIGURE%"=="1" (
"%CMAKE%" ^
%BUILD_CMAKE_ARGS% ^
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)
)
echo echo off > %BUILD_DIR%\rebuild.cmd
echo if "%%VSCMD_VER%%" == "" ^( >> %BUILD_DIR%\rebuild.cmd
echo call "%VCVARS%" %BUILD_ARCH% >> %BUILD_DIR%\rebuild.cmd
echo ^) >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd
echo ninja install %%* >> %BUILD_DIR%\rebuild.cmd
echo echo %%TIME%% ^>^> buildtime.txt >> %BUILD_DIR%\rebuild.cmd