-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathkwiver-flags-msvc.cmake
34 lines (30 loc) · 1.07 KB
/
kwiver-flags-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
34
#
# Compiler flags specific to MSVC
#
option( ${CMAKE_PROJECT_NAME}_ENABLE_DLL_WARNINGS "Enable warnings about DLL visibility." OFF)
if (NOT ${CMAKE_PROJECT_NAME}_ENABLE_DLL_WARNINGS)
kwiver_check_compiler_flag(/wd4251)
kwiver_check_compiler_flag(/wd4275)
endif()
kwiver_check_compiler_flag(/W3)
kwiver_check_compiler_flag(/MP)
kwiver_check_compiler_flag(/utf-8)
# Disable deprication warnings for standard C and STL functions in VS2005 and
# later.
if (MSVC_VERSION GREATER 1400 OR
MSVC_VERSION EQUAL 1400)
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_DEPRECATE)
endif()
# Prevent namespace pollution
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DNOMINMAX)
add_definitions(-DWINDOWS_EXTRA_LEAN)
if(${MSVC_VERSION} GREATER_EQUAL 1915)
# You must acknowledge that you understand MSVC
# resolved a byte alignment issue in this compiler.
# We get this due to using Eigen objects and
# allocating those objects with make_shared
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
endif()