diff options
author | Ray Molenkamp <github@lazydodo.com> | 2018-05-28 23:35:59 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2018-05-28 23:35:59 +0300 |
commit | 5d1a172783e65a6c4c52ad112aff64d3b63d0b6c (patch) | |
tree | 02be093686847beb79d430a197ae09b4b1055a69 /build_files | |
parent | 66577c8732f4957e4afa5cafb18259ea589e74b6 (diff) | |
parent | 81060ff6b26c22331d2066bb83d492bbe61e936c (diff) |
Merge remote-tracking branch 'origin/master' into blender2.8
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/build_environment/patches/boost.diff | 22 | ||||
-rw-r--r-- | build_files/build_environment/patches/osl.diff | 26 | ||||
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 17 | ||||
-rw-r--r-- | build_files/windows/configure_msbuild.cmd | 4 | ||||
-rw-r--r-- | build_files/windows/configure_ninja.cmd | 6 | ||||
-rw-r--r-- | build_files/windows/parse_arguments.cmd | 3 | ||||
-rw-r--r-- | build_files/windows/reset_variables.cmd | 1 |
7 files changed, 76 insertions, 3 deletions
diff --git a/build_files/build_environment/patches/boost.diff b/build_files/build_environment/patches/boost.diff index ea3ec035518..41b40d7a915 100644 --- a/build_files/build_environment/patches/boost.diff +++ b/build_files/build_environment/patches/boost.diff @@ -13,3 +13,25 @@ -# pragma message("Unknown compiler version - please run the configure tests and report the results") -# endif -#endif +--- a/boost/type_traits/has_nothrow_assign.hpp 2015-12-13 05:49:42 -0700 ++++ b/boost/type_traits/has_nothrow_assign.hpp 2018-05-27 11:11:02 -0600 +@@ -24,7 +24,7 @@ + #include <boost/type_traits/remove_reference.hpp> + #endif + #endif +-#if defined(__GNUC__) || defined(__SUNPRO_CC) ++#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__clang__) + #include <boost/type_traits/is_const.hpp> + #include <boost/type_traits/is_volatile.hpp> + #include <boost/type_traits/is_assignable.hpp> +--- a/boost/type_traits/has_nothrow_constructor.hpp 2015-12-13 05:49:42 -0700 ++++ b/boost/type_traits/has_nothrow_constructor.hpp 2018-05-27 11:11:02 -0600 +@@ -17,7 +17,7 @@ + #if defined(BOOST_MSVC) || defined(BOOST_INTEL) + #include <boost/type_traits/has_trivial_constructor.hpp> + #endif +-#if defined(__GNUC__ ) || defined(__SUNPRO_CC) ++#if defined(__GNUC__ ) || defined(__SUNPRO_CC) || defined(__clang__) + #include <boost/type_traits/is_default_constructible.hpp> + #endif + diff --git a/build_files/build_environment/patches/osl.diff b/build_files/build_environment/patches/osl.diff index fcb5ec4165f..960a2506374 100644 --- a/build_files/build_environment/patches/osl.diff +++ b/build_files/build_environment/patches/osl.diff @@ -10,3 +10,29 @@ diff -Naur osl/src/external_osl/src/cmake/flexbison.cmake osl_bak/src/external_o MAIN_DEPENDENCY ${flexsrc} DEPENDS ${${compiler_headers}} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) +--- a/src/include/OSL/oslconfig.h 2016-10-31 16:48:19 -0600 ++++ b/src/include/OSL/oslconfig.h 2018-05-27 11:18:08 -0600 +@@ -44,12 +44,18 @@ + // same if another packages is compiling against OSL and using these headers + // (OSL may be C++11 but the client package may be older, or vice versa -- + // use these two symbols to differentiate these cases, when important). +-#if (__cplusplus >= 201402L) +-# define OSL_CPLUSPLUS_VERSION 14 +-#elif (__cplusplus >= 201103L) +-# define OSL_CPLUSPLUS_VERSION 11 ++ ++// Force C++03 for MSVC in blender since svn the libraries are build with that ++#if !defined(_MSC_VER) ++ #if (__cplusplus >= 201402L) ++ # define OSL_CPLUSPLUS_VERSION 14 ++ #elif (__cplusplus >= 201103L) ++ # define OSL_CPLUSPLUS_VERSION 11 ++ #else ++ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */ ++ #endif + #else +-# define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */ ++ # define OSL_CPLUSPLUS_VERSION 3 /* presume C++03 */ + #endif + + // Symbol export defines diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 606e4e59571..8980b7e0bea 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -29,7 +29,10 @@ if(NOT MSVC) message(FATAL_ERROR "Compiler is unsupported") endif() -# Libraries configuration for Windows when compiling with MSVC. +if(CMAKE_C_COMPILER_ID MATCHES "Clang") + set(MSVC_CLANG On) + file(TO_CMAKE_PATH $ENV{VCToolsRedistDir} MSVC_REDIST_DIR) +endif() set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS}) @@ -121,8 +124,16 @@ include(InstallRequiredSystemLibraries) remove_cc_flag("/MDd" "/MD") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP") +if(MSVC_CLANG) # Clangs version of cl doesn't support all flags + if(NOT WITH_CXX11) # C++11 is on by default in clang-cl and can't be turned off, if c++11 is not enabled in blender repress some c++11 related warnings. + set(CXX_WARN_FLAGS "-Wno-inconsistent-missing-override") + endif() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference") +else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /nologo /J /Gd /MP /EHsc") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /nologo /J /Gd /MP") +endif() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") diff --git a/build_files/windows/configure_msbuild.cmd b/build_files/windows/configure_msbuild.cmd index 135b7933ab2..95a8882a9ab 100644 --- a/build_files/windows/configure_msbuild.cmd +++ b/build_files/windows/configure_msbuild.cmd @@ -4,6 +4,10 @@ if "%BUILD_ARCH%"=="x64" ( set MSBUILD_PLATFORM=x64 ) else if "%BUILD_ARCH%"=="x86" ( set MSBUILD_PLATFORM=win32 + if "%WITH_CLANG%"=="1" ( + echo Clang not supported for X86 + exit /b 1 + ) ) if NOT EXIST %BUILD_DIR%\nul ( diff --git a/build_files/windows/configure_ninja.cmd b/build_files/windows/configure_ninja.cmd index 13797543bcc..24911a10275 100644 --- a/build_files/windows/configure_ninja.cmd +++ b/build_files/windows/configure_ninja.cmd @@ -1,4 +1,10 @@ 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. + exit /b 1 +) + :DetectionComplete if NOT "%verbose%" == "" ( echo BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index 5a82bf3cf04..1cb2e1f3e8c 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -36,6 +36,9 @@ if NOT "%1" == "" ( ) else if "%1" == "bpy" ( 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 WITH_CLANG=1 ) else if "%1" == "release" ( set TARGET=Release ) else if "%1" == "x86" ( diff --git a/build_files/windows/reset_variables.cmd b/build_files/windows/reset_variables.cmd index 34af3ff9389..d9a50a7f809 100644 --- a/build_files/windows/reset_variables.cmd +++ b/build_files/windows/reset_variables.cmd @@ -21,3 +21,4 @@ set BUILD_UPDATE= set BUILD_SHOW_HASHES= set SHOW_HELP= set BUILD_WITH_NINJA= +set WITH_CLANG=
\ No newline at end of file |