diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-07-05 10:16:41 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-07-05 10:24:19 +0200 |
commit | b71acc205681c467b120046a840421329b2bbdda (patch) | |
tree | ba4c00c65556aeb936532fc5e5fca253581fed9c /CMakeLists.txt | |
parent | b4789b67eb1534e3ae0e88f4661b634df7c68a21 (diff) |
cmake: add default flags for gcc/clang
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d60b8510..a7a95d2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,15 @@ endif() include(CMakeDetermineCCompiler) include(CMakeDetermineCXXCompiler) + +if(CMAKE_COMPILER_IS_GNUCXX AND NOT __otr_compile_flags_set) + set(__otr_compile_flags_set TRUE CACHE INTERNAL "" FORCE) + foreach(i C CXX) + set(CMAKE_${i}_FLAGS_RELEASE "-O3 -march=native" CACHE STRING "" FORCE) + set(CMAKE_${i}_FLAGS "-ggdb -Wall -Wextra -Wpedantic" CACHE STRING "" FORCE) + endforeach() +endif() + include(CMakeParseArguments) include(opentrack-load-user-settings) |