diff --git a/CMakeLists.txt b/CMakeLists.txt index d090b2f79c0..fcd92b5512a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,13 @@ endif() include(CMakeDependentOption) +# CMAKE_CROSSCOMPILING and MSVC_IDE are not set until project() is called, so let's test this instead +if ((DEFINED CMAKE_TOOLCHAIN_FILE) AND (CMAKE_GENERATOR MATCHES "Visual Studio.*")) +# Do not use MSVC_RUNTIME_LIBRARY target property. We use our own flags instead +message(WARNING "Setting policy CMP0091 to OLD behaviour") +cmake_policy(SET CMP0091 OLD) +endif() + project(REACTOS) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -120,6 +127,12 @@ else() # Print build type message("-- Build Type: ${CMAKE_BUILD_TYPE}") + # Always add /MT in VS CMAKE_GENERATOR + if (MSVC_IDE) + add_compile_options("/MT") + endif() + + # adjust the default behaviour of the FIND_XXX() commands: # search headers and libraries in the target environment, search # programs in the host environment diff --git a/toolchain-msvc.cmake b/toolchain-msvc.cmake index dbb901ae874..2aae2edbdd4 100644 --- a/toolchain-msvc.cmake +++ b/toolchain-msvc.cmake @@ -64,7 +64,6 @@ else() set(CMAKE_ASM_MASM_FLAGS_INIT "/Cp") endif() - set(CMAKE_C_STANDARD_LIBRARIES "" CACHE INTERNAL "") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_LIST_DIR}/overrides-msvc.cmake")