forked from boostorg/json
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmsvc.cmake
33 lines (28 loc) · 865 Bytes
/
msvc.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Include common options.
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
# Static runtime linkage.
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "")
# Compiler options.
add_compile_options(
/permissive- # strict C++
/W4 # enable all warnings
/MP # multi-processor compilation
)
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32") # 32-bit
add_compile_options(
/arch:SSE2
)
endif()
# Linker options.
add_link_options(
)
# Disable logos.
foreach(lang C CXX ASM_MASM RC)
set(CMAKE_${lang}_FLAGS_INIT "/nologo")
endforeach()
foreach(type EXE SHARED MODULE)
set(CMAKE_${type}_LINKER_FLAGS_INIT "/nologo")
endforeach()
# Silence Visual Studio CMake integration warnings.
set(SILENCE_VS_DEFINITIONS ${CMAKE_TOOLCHAIN_FILE} ${CMAKE_C_COMPILER})
set(SILENCE_VS_DEFINITIONS)