make.bat : add support for building with ninja and clang together.
authorRay Molenkamp <github@lazydodo.com>
Tue, 29 May 2018 01:56:17 +0000 (19:56 -0600)
committerRay Molenkamp <github@lazydodo.com>
Tue, 29 May 2018 01:56:17 +0000 (19:56 -0600)
build_files/windows/build_ninja.cmd
build_files/windows/configure_msbuild.cmd
build_files/windows/configure_ninja.cmd
build_files/windows/parse_arguments.cmd

index f6b266e206d2ca487f7b4e465d398affcd384b8f..4f1a5408c28fe3d994fff8240b7ee8ea1a48496e 100644 (file)
@@ -10,7 +10,7 @@ echo %TIME% >>buildtime.txt
 cd %BLENDER_DIR%
 
 if "%HAS_ERROR%" == "1" (
-               echo Error during build, see %BUILD_DIR%\Build.log for details 
+               echo Error during build
                exit /b 1
 )
 :EOF
\ No newline at end of file
index 95a8882a9ab4e5c38516940551fbb60169e6533e..f06f3e317eeb7eaff816a243089f5b4a431d5db5 100644 (file)
@@ -10,6 +10,10 @@ if "%BUILD_ARCH%"=="x64" (
        )
 )
 
+if "%WITH_CLANG%"=="1" (
+       set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
+)
+
 if NOT EXIST %BUILD_DIR%\nul (
        mkdir %BUILD_DIR%
 )
index 24911a10275c394d510c4b62ac08b1eb184166b4..f882ca3dbf056f65bc5268812e752d54400c238f 100644 (file)
@@ -1,11 +1,34 @@
 set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
 
 if "%WITH_CLANG%" == "1" (
-       echo Building with ninja and clang not supported yet.
+set LLVM_DIR=
+       for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
+       if DEFINED LLVM_DIR (
+               if NOT "%verbose%" == "" (
+                       echo LLVM Detected at "%LLVM_DIR%"
+               )
+       goto DetectionComplete
+       )
+
+       REM Check 32 bits
+       for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C
+       if DEFINED LLVM_DIR (
+               if NOT "%verbose%" == "" (
+                       echo LLVM Detected at "%LLVM_DIR%"
+               )
+               goto DetectionComplete
+       )
+       echo LLVM not found 
        exit /b 1
+       
+:DetectionComplete     
+       set CC=%LLVM_DIR%\bin\clang-cl
+       set CXX=%LLVM_DIR%\bin\clang-cl
+       rem build and tested against 2017 15.7
+       set CFLAGS=-m64 -fmsc-version=1914
+       set CXXFLAGS=-m64 -fmsc-version=1914
 )
 
-:DetectionComplete
 if NOT "%verbose%" == "" (
        echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% 
 )
index 1cb2e1f3e8ca237b92d5e4ed526f213aa224135b..016bc875c3bb604f54322dc009a4c9bf739c2162 100644 (file)
@@ -37,7 +37,7 @@ if NOT "%1" == "" (
                set TARGET=Bpy
                set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake"
        ) else if "%1" == "clang" (
-               set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -T"LLVM-vs2017"
+               set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS%
                set WITH_CLANG=1
        ) else if "%1" == "release" (
                set TARGET=Release