build: static link the CRT for cmake+msvc build

This commit is contained in:
Eric Wasylishen 2015-12-07 15:52:45 -08:00
parent 063786bf02
commit 0a165f9dcd
1 changed files with 4 additions and 1 deletions

View File

@ -35,8 +35,11 @@ if (WIN32)
set(CMAKE_EXE_LINKER_FLAGS -Wl,--stack,${STACKSIZE})
endif (WIN32)
#MSVC: /MT is to static link the CRT.
if (MSVC)
set(CMAKE_EXE_LINKER_FLAGS /STACK:${STACKSIZE} )
set(CMAKE_EXE_LINKER_FLAGS "/STACK:${STACKSIZE}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
endif (MSVC)
add_subdirectory(bspinfo)