Changeset View
Changeset View
Standalone View
Standalone View
build_files/cmake/platform/platform_win32.cmake
| Show All 29 Lines | if(CMAKE_C_COMPILER_ID MATCHES "Clang") | ||||
| set(MSVC_CLANG On) | set(MSVC_CLANG On) | ||||
| set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables") | set(VC_TOOLS_DIR $ENV{VCToolsRedistDir} CACHE STRING "Location of the msvc redistributables") | ||||
| set(MSVC_REDIST_DIR ${VC_TOOLS_DIR}) | set(MSVC_REDIST_DIR ${VC_TOOLS_DIR}) | ||||
| if(DEFINED MSVC_REDIST_DIR) | if(DEFINED MSVC_REDIST_DIR) | ||||
| file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR) | file(TO_CMAKE_PATH ${MSVC_REDIST_DIR} MSVC_REDIST_DIR) | ||||
| else() | else() | ||||
| message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.") | message("Unable to detect the Visual Studio redist directory, copying of the runtime dlls will not work, try running from the visual studio developer prompt.") | ||||
| endif() | endif() | ||||
| # 1) CMake has issues detecting openmp support in clang-cl so we have to provide | |||||
| # the right switches here. | |||||
| # 2) While the /openmp switch *should* work, it currently doesn't as for clang 9.0.0 | |||||
| if(WITH_OPENMP) | |||||
| set(OPENMP_CUSTOM ON) | |||||
| 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) | |||||
| set(CLANG_OPENMP_DLL "${LLVMROOT}/bin/libomp.dll") | |||||
| if(NOT EXISTS "${CLANG_OPENMP_DLL}") | |||||
| message(FATAL_ERROR "Clang OpenMP library (${CLANG_OPENMP_DLL}) not found.") | |||||
| endif() | |||||
| set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LLVMROOT}/lib/libomp.lib") | |||||
| endif() | |||||
| endif() | endif() | ||||
| set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS}) | set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS}) | ||||
| if(NOT WITH_PYTHON_MODULE) | if(NOT WITH_PYTHON_MODULE) | ||||
| set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender) | set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender) | ||||
| endif() | endif() | ||||
| ▲ Show 20 Lines • Show All 648 Lines • Show Last 20 Lines | |||||