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 <gen> <options>
    -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
    -DMSVC_BUILD_STATIC=ON
    -DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded$<$<CONFIG:Debug>:Debug>"

When MSVC_BUILD_DEBUG is set the test 'posix-mock-test' is skipped as it
does not build with the static runtime.
This commit is contained in:
Richard Musil 2019-09-24 22:24:38 +02:00
parent f6afb5e0f3
commit 6e68b51687

View File

@ -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$<$<CONFIG:Debug>:Debug>")
message (STATUS "Building with static CRT.")
else()
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>: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)