#判断编译器类型if(MSVC)#添加一个名为WITH_CRT_DLL的开关选项, #这样就可以在cmake-gui中或在命令行随时修改该开关选项。option(WITH_CRT_DLL"Link all libjpeg-turbo libraries and executables with the C run-time DLL (msvcr*.dll) instead of the static C run-time library (libcmt*.lib.) The de...
if(BUILD_CPP_TEST AND MSVC) # Use /MT flag to statically link the C runtime set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") endif() if(USE_CUDA) find_package(CUDAToolkit 11.0 REQUIRED) include_directories(${CUDAToolkit_INCLUDE_DIRS}) @@ -685,18 +690,6 @@...
if(MSVC)# Use thestaticClibraryforall build typesMESSAGE(STATUS"link to static C and C++ runtime lirbary(/MT /MTd)")foreach(varCMAKE_C_FLAGS_DEBUG_INITCMAKE_C_FLAGS_RELEASE_INITCMAKE_C_FLAGS_MINSIZEREL_INITCMAKE_C_FLAGS_RELWITHDEBINFO_INITCMAKE_CXX_FLAGS_DEBUG_INITCMAKE_CXX_FLAGS_...
I am using the CMAKE_MSVC_RUNTIME_LIBRARY option so that MSVC uses /MTd to statically link an executable. CMakeLists.txt cmake_minimum_required (VERSION 3.15 FATAL_ERROR) cmake_policy(SET CMP0091 NEW) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debu...
but that's probably fine - we should move over to the new upstream CMake mechanism anyway, and push users towards that. Change code in compiler-rt, that previously tried to override the CRT choice to /MT, to set CMAKE_MSVC_RUNTIME_LIBRARY instead of meddling in the old variables. This...
Is it possible for the Rust bindings to opt into set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")? Should passing it to -D work? It doesn't seem to be, so either I need a different way or my buildscript is broken. Thanks. Collaborator ahicks92 commented Nov 11, 2020 I'm not ...