cmake: static: add msvc check before adding msvc flags

When building with STATIC_BUILD=ON, different flags need to be specified
when using MSVC.  Check for this flag and only set them if necessary.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-08-15 16:28:03 +08:00
parent aa7e20357f
commit 8b63de9e55

View File

@ -16,7 +16,7 @@ set(link_param "")
if (STATIC_BUILD)
set(Boost_USE_STATIC_LIBS ON)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
if (BUILD_PYTHON)