mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
Merge pull request #1860 from rofferom/msvc-allow-static-runtime
CMake: Add SPDLOG_STATIC_VCRT to choose static MSVC runtime
This commit is contained in:
commit
2ffbbee1f6
@ -2,6 +2,8 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
|
||||
# ---------------------------------------------------------------------------------------
|
||||
# Start spdlog project
|
||||
# ---------------------------------------------------------------------------------------
|
||||
@ -87,6 +89,7 @@ endif()
|
||||
if(WIN32)
|
||||
option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF)
|
||||
option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF)
|
||||
option(SPDLOG_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
option(SPDLOG_CLOCK_COARSE
|
||||
@ -124,6 +127,10 @@ if(NOT SPDLOG_FMT_EXTERNAL AND NOT SPDLOG_FMT_EXTERNAL_HO)
|
||||
list(APPEND SPDLOG_SRCS src/fmt.cpp)
|
||||
endif()
|
||||
|
||||
if(MSVC AND SPDLOG_STATIC_VCRT)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
endif()
|
||||
|
||||
if(SPDLOG_BUILD_SHARED OR BUILD_SHARED_LIBS)
|
||||
if(WIN32)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY)
|
||||
|
Loading…
Reference in New Issue
Block a user