-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompiler.cmake
41 lines (37 loc) · 908 Bytes
/
compiler.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
35
36
37
38
39
40
41
add_library( cxx::flags INTERFACE IMPORTED )
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
target_compile_options( cxx::flags INTERFACE
-Wall
#-Wconversion # disabled because bit-field narrowing conversion
-Werror
-Wextra
-Wno-interference-size
-Wno-missing-field-initializers
-Wno-multichar
-Wpedantic
-Wshadow
-fno-exceptions
-fno-rtti
)
elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
target_compile_options( cxx::flags INTERFACE
-Wall
-Wconversion
-Werror
-Wextra
-Wno-missing-field-initializers
-Wno-multichar
-Wno-string-conversion
-Wpedantic
-Wshadow
-fno-exceptions
-fno-rtti
)
elseif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" )
target_compile_options( cxx::flags INTERFACE
/D _ENABLE_EXTENDED_ALIGNED_STORAGE=1
/wd4566
)
else ()
message( FATAL_ERROR "Unsuported compiler" )
endif()