[CMAKE] Disable policy CMP0091 and set /MT flag explicitly for Visual Studio generator

This commit is contained in:
Jérôme Gardou 2021-01-22 12:11:34 +01:00 committed by Jérôme Gardou
parent c68739e566
commit 49000c6471
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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")