1
0
mirror of https://github.com/pdewacht/brlaser synced 2024-12-26 15:38:20 +01:00

Tweak compiler flags

This commit is contained in:
Peter De Wachter 2020-04-19 21:05:03 +02:00
parent cecfceb27a
commit e21f52f437

View File

@ -39,10 +39,11 @@ endmacro(extra_cxx_compiler_flag)
# Compiler warnings # Compiler warnings
extra_cxx_compiler_flag("-Wall") extra_cxx_compiler_flag("-Wall")
extra_cxx_compiler_flag("-Wno-missing-braces") extra_cxx_compiler_flag("-Wno-missing-braces")
# Some security flags extra_cxx_compiler_flag("-Wdate-time")
# Some hardening flags
extra_cxx_compiler_flag("-fstack-protector-strong") extra_cxx_compiler_flag("-fstack-protector-strong")
extra_cxx_compiler_flag("-Wformat") extra_cxx_compiler_flag("-Wformat")
extra_cxx_compiler_flag("-Werror=format-security") extra_cxx_compiler_flag("-Wformat -Werror=format-security")
extra_cxx_compiler_flag("-D_FORTIFY_SOURCE=2") extra_cxx_compiler_flag("-D_FORTIFY_SOURCE=2")
# Enable the supported flags, but give priority to CXXFLAGS env var # Enable the supported flags, but give priority to CXXFLAGS env var
set(CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "${EXTRA_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")