diff options
author | Ray Molenkamp <github@lazydodo.com> | 2022-10-05 18:46:18 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2022-10-05 18:46:18 +0300 |
commit | 42736e0b3f85dc248186dd6dc5349a99addc8c84 (patch) | |
tree | d0768a91d8ebfb50642034fdf8437199a5e420b7 /build_files/cmake/platform/platform_win32.cmake | |
parent | 42ce93a2cbc28836d22b7fa47e99aa3df76e1acc (diff) | |
parent | b47a234f98dd7e6e0b53ad96b5b4d278635874d8 (diff) |
Merge remote-tracking branch 'origin/master' into tmp-vfx-platform-2023
Diffstat (limited to 'build_files/cmake/platform/platform_win32.cmake')
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 68 |
1 files changed, 29 insertions, 39 deletions
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index c8336f36b5a..afcb1a2a4f0 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -26,7 +26,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang") set(OPENMP_FOUND ON) set(OpenMP_C_FLAGS "/clang:-fopenmp") set(OpenMP_CXX_FLAGS "/clang:-fopenmp") - GET_FILENAME_COMPONENT(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE) + get_filename_component(LLVMROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\LLVM\\LLVM;]" ABSOLUTE CACHE) set(CLANG_OPENMP_DLL "${LLVMROOT}/bin/libomp.dll") set(CLANG_OPENMP_LIB "${LLVMROOT}/lib/libomp.lib") if(NOT EXISTS "${CLANG_OPENMP_DLL}") @@ -74,27 +74,6 @@ add_definitions(-DWIN32) add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>") add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>") -# Minimum MSVC Version -if(CMAKE_CXX_COMPILER_ID MATCHES MSVC) - if(MSVC_VERSION EQUAL 1800) - set(_min_ver "18.0.31101") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver}) - message(FATAL_ERROR - "Visual Studio 2013 (Update 4, ${_min_ver}) required, " - "found (${CMAKE_CXX_COMPILER_VERSION})") - endif() - endif() - if(MSVC_VERSION EQUAL 1900) - set(_min_ver "19.0.24210") - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${_min_ver}) - message(FATAL_ERROR - "Visual Studio 2015 (Update 3, ${_min_ver}) required, " - "found (${CMAKE_CXX_COMPILER_VERSION})") - endif() - endif() -endif() -unset(_min_ver) - # needed for some MSVC installations # 4099 : PDB 'filename' was not found with 'object/library' string(APPEND CMAKE_EXE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099") @@ -192,7 +171,7 @@ endif() # C++ standards conformace (/permissive-) is available on msvc 15.5 (1912) and up -if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG) +if(NOT MSVC_CLANG) string(APPEND CMAKE_CXX_FLAGS " /permissive-") # Two-phase name lookup does not place nicely with OpenMP yet, so disable for now string(APPEND CMAKE_CXX_FLAGS " /Zc:twoPhase-") @@ -252,7 +231,7 @@ unset(SYMBOL_FORMAT) unset(SYMBOL_FORMAT_RELEASE) # JMC is available on msvc 15.8 (1915) and up -if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG) +if(NOT MSVC_CLANG) string(APPEND CMAKE_CXX_FLAGS_DEBUG " /JMC") endif() @@ -285,9 +264,6 @@ if(NOT DEFINED LIBDIR) elseif(MSVC_VERSION GREATER 1919) message(STATUS "Visual Studio 2019 detected.") set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15) - elseif(MSVC_VERSION GREATER 1909) - message(STATUS "Visual Studio 2017 detected.") - set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc15) endif() else() message(STATUS "Using pre-compiled LIBDIR: ${LIBDIR}") @@ -298,10 +274,8 @@ endif() include(platform_old_libs_update) -if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND # Only supported in the VS IDE - MSVC_VERSION GREATER_EQUAL 1924 AND # Supported for 16.4+ - WITH_CLANG_TIDY # And Clang Tidy needs to be on - ) +# Only supported in the VS IDE & Clang Tidy needs to be on. +if(CMAKE_GENERATOR MATCHES "^Visual Studio.+" AND WITH_CLANG_TIDY) set(CMAKE_VS_GLOBALS "RunCodeAnalysis=false" "EnableMicrosoftCodeAnalysis=false" @@ -312,8 +286,7 @@ endif() # Mark libdir as system headers with a lower warn level, to resolve some warnings # that we have very little control over -if(MSVC_VERSION GREATER_EQUAL 1914 AND # Available with 15.7+ - NOT MSVC_CLANG AND # But not for clang +if(NOT MSVC_CLANG AND # Available with MSVC 15.7+ but not for CLANG. NOT WITH_WINDOWS_SCCACHE AND # And not when sccache is enabled NOT VS_CLANG_TIDY) # Clang-tidy does not like these options add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0) @@ -529,12 +502,16 @@ if(WITH_JACK) endif() if(WITH_PYTHON) - set(PYTHON_VERSION 3.10) # CACHE STRING) + # Cache version for make_bpy_wheel.py to detect. + unset(PYTHON_VERSION CACHE) + set(PYTHON_VERSION "3.10" CACHE STRING "Python version") string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION}) set(PYTHON_LIBRARY ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}.lib) set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/libs/python${_PYTHON_VERSION_NO_DOTS}_d.lib) + set(PYTHON_EXECUTABLE ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/bin/python$<$<CONFIG:Debug>:_d>.exe) + set(PYTHON_INCLUDE_DIR ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/include) set(PYTHON_NUMPY_INCLUDE_DIRS ${LIBDIR}/python/${_PYTHON_VERSION_NO_DOTS}/lib/site-packages/numpy/core/include) set(NUMPY_FOUND ON) @@ -800,7 +777,7 @@ if(WITH_TBB) endif() # used in many places so include globally, like OpenGL -blender_include_dirs_sys("${PTHREADS_INCLUDE_DIRS}") +include_directories(SYSTEM "${PTHREADS_INCLUDE_DIRS}") set(WINTAB_INC ${LIBDIR}/wintab/include) @@ -907,8 +884,8 @@ endif() if(WINDOWS_PYTHON_DEBUG) # Include the system scripts in the blender_python_system_scripts project. - FILE(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" ) - ADD_CUSTOM_TARGET(blender_python_system_scripts SOURCES ${inFiles}) + file(GLOB_RECURSE inFiles "${CMAKE_SOURCE_DIR}/release/scripts/*.*" ) + add_custom_target(blender_python_system_scripts SOURCES ${inFiles}) foreach(_source IN ITEMS ${inFiles}) get_filename_component(_source_path "${_source}" PATH) string(REPLACE "${CMAKE_SOURCE_DIR}/release/scripts/" "" _source_path "${_source_path}") @@ -928,8 +905,8 @@ if(WINDOWS_PYTHON_DEBUG) endif() file(TO_CMAKE_PATH ${USER_SCRIPTS_ROOT} USER_SCRIPTS_ROOT) - FILE(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" ) - ADD_CUSTOM_TARGET(blender_python_user_scripts SOURCES ${inFiles}) + file(GLOB_RECURSE inFiles "${USER_SCRIPTS_ROOT}/*.*" ) + add_custom_target(blender_python_user_scripts SOURCES ${inFiles}) foreach(_source IN ITEMS ${inFiles}) get_filename_component(_source_path "${_source}" PATH) string(REPLACE "${USER_SCRIPTS_ROOT}" "" _source_path "${_source_path}") @@ -996,6 +973,19 @@ if(WITH_HARU) endif() endif() +if(WITH_CYCLES_PATH_GUIDING) + find_package(openpgl QUIET) + if(openpgl_FOUND) + get_target_property(OPENPGL_LIBRARIES_RELEASE openpgl::openpgl LOCATION_RELEASE) + get_target_property(OPENPGL_LIBRARIES_DEBUG openpgl::openpgl LOCATION_DEBUG) + set(OPENPGL_LIBRARIES optimized ${OPENPGL_LIBRARIES_RELEASE} debug ${OPENPGL_LIBRARIES_DEBUG}) + get_target_property(OPENPGL_INCLUDE_DIR openpgl::openpgl INTERFACE_INCLUDE_DIRECTORIES) + else() + set(WITH_CYCLES_PATH_GUIDING OFF) + message(STATUS "OpenPGL not found, disabling WITH_CYCLES_PATH_GUIDING") + endif() +endif() + set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include) set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib) |