From 6e68b516874e796562af33e2a35dfd9e60f28e7f Mon Sep 17 00:00:00 2001 From: Richard Musil Date: Tue, 24 Sep 2019 22:24:38 +0200 Subject: [PATCH] Removed MSVC_RUNTIME_LIBRARY logic from the CMake file. The static build can be set on the command line with CMake >= 3.15 by defining the policy and the CMAKE_MSVC_RUNTIME_LIBARY this way: cmake -G -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DMSVC_BUILD_STATIC=ON -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$:Debug>" When MSVC_BUILD_DEBUG is set the test 'posix-mock-test' is skipped as it does not build with the static runtime. --- CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4972e873..6e08aa5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,19 +7,6 @@ else() cmake_policy(VERSION 3.11) endif() -if (NOT ${CMAKE_VERSION} VERSION_LESS 3.15) - # Set policy to accept MSVC runtime selector (requires CMake >= 3.15) - cmake_policy (SET CMP0091 NEW) - option(MSVC_BUILD_STATIC "Enable building with static CRT." OFF) - if (MSVC_BUILD_STATIC) - set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - message (STATUS "Building with static CRT.") - else() - set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL") - message (STATUS "Building with dynamic CRT.") - endif() -endif() - # Determine if fmt is built as a subproject (using add_subdirectory) # or if it is the master project. set(MASTER_PROJECT OFF)