add option to enable linking with static C runtime when compiling with MSVC, #214

pull/243/head
Thomas Fussell 2017-09-13 10:20:51 -04:00
parent 81812d6e29
commit f27df9732c
5 changed files with 7 additions and 9 deletions

View File

@ -14,7 +14,9 @@ option(BENCHMARKS "Set to ON to build performance benchmarks (in ./benchmarks)"
option(PYTHON "Set to ON to build Arrow conversion functions (in ./python)" OFF)
# Platform specific options
if(NOT MSVC)
if(MSVC)
option(STATIC_CRT "Link with the static version of MSVCRT (/MD[d])" OFF)
else()
option(COVERAGE "Generate coverage data using gcov" OFF)
endif()

View File

@ -10,8 +10,7 @@ if(NOT COMBINED_PROJECT)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
endif()
if(MSVC AND STATIC)
# Link with static C runtime
if(STATIC_CRT)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ucm.cmake)
ucm_set_runtime(STATIC)
endif()

View File

@ -10,8 +10,7 @@ if(NOT COMBINED_PROJECT)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
endif()
if(MSVC AND STATIC)
# Link with static C runtime
if(STATIC_CRT)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ucm.cmake)
ucm_set_runtime(STATIC)
endif()

View File

@ -45,8 +45,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas") # ignore Windows and GCC pragmas
endif()
if(MSVC AND STATIC)
# Link with static C runtime
if(STATIC_CRT)
include(${XLNT_ROOT_DIR}/cmake/ucm.cmake)
ucm_set_runtime(STATIC)
endif()

View File

@ -9,8 +9,7 @@ if(NOT COMBINED_PROJECT)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../source ${CMAKE_CURRENT_BINARY_DIR}/source)
endif()
if(MSVC AND STATIC)
# Link with static C runtime
if(STATIC_CRT)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/ucm.cmake)
ucm_set_runtime(STATIC)
endif()