Fix debug build on Windows

Specify static linking to VC runtime libs under both debug and release
builds

MD-19678 #time 10m
This commit is contained in:
Robert Knight 2013-09-04 18:58:40 +01:00
parent 465788b400
commit 7335ee3eac

View file

@ -23,10 +23,13 @@ include_directories(external/win32cpp/include)
# Link the updater binary statically with the Visual C++ runtime # Link the updater binary statically with the Visual C++ runtime
# so that the executable can function standalone # so that the executable can function standalone
set(CMAKE_CXX_FLAGS_DEBUG "/MT")
set(CMAKE_C_FLAGS_DEBUG "/MT")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
remove_definitions(-DUNICODE -D_UNICODE)
remove_definitions(-DUNICODE -D_UNICODE)
else() else()
# optimize for reduced code size # optimize for reduced code size
set(CMAKE_CXX_FLAGS_RELEASE "-Os") set(CMAKE_CXX_FLAGS_RELEASE "-Os")