Crow/cmake/compiler_options.cmake

26 lines
494 B
CMake
Raw Normal View History

2021-01-08 15:15:45 +00:00
# Compiler options with hardening flags
if(MSVC)
list(APPEND compiler_options
/W4
/permissive-
2021-01-11 05:59:32 +00:00
$<$<CONFIG:RELEASE>:/O2 /Ob2>
2021-01-08 15:15:45 +00:00
$<$<CONFIG:MINSIZEREL>:/O1 /Ob1>
$<$<CONFIG:RELWITHDEBINFO>:/Zi /O2 /Ob1>
$<$<CONFIG:DEBUG>:/Zi /Ob0 /Od /RTC1>)
else(MSVC)
list(APPEND compiler_options
-Wall
-Wextra
-Wpedantic
$<$<CONFIG:RELEASE>:-O2>
$<$<CONFIG:DEBUG>:-O0>
$<$<CONFIG:DEBUG>:-g>
$<$<CONFIG:DEBUG>:-p>
$<$<CONFIG:DEBUG>:-pg>)
endif()