allow windows users to choose dynamic runtime dll build

update-fork
erik aronesty 5 years ago
parent e0f7f5d073
commit c155ee3960
  1. 14
      CMakeLists.txt

@ -42,6 +42,11 @@ option(
"only lib"
OFF
)
option(
MSVC_RUNTIME_DLL
"use dynamic runtime /MD in msvc builds"
OFF
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@ -66,8 +71,13 @@ if(USE_LLVM)
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT /W4 /Oy /Ox /EHsc /GS- /Zi /DNDEBUG /DNOMINMAX")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MTd /W4 /DNOMINMAX")
if(MSVC_RUNTIME_DLL)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MD /W4 /Oy /Ox /EHsc /GS- /Zi /DNDEBUG /DNOMINMAX")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MDd /W4 /DNOMINMAX")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /MT /W4 /Oy /Ox /EHsc /GS- /Zi /DNDEBUG /DNOMINMAX")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} /MTd /W4 /DNOMINMAX")
endif()
link_directories(${CMAKE_SOURCE_DIR}/../cybozulib_ext/lib)
link_directories(${CMAKE_SOURCE_DIR}/lib)
else()

Loading…
Cancel
Save