diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2017-11-11 10:33:04 +0100 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@ugent.be> | 2017-11-13 13:37:44 +0100 |
commit | af3d6479ddbfe995b0ae8bb1488e8756e32c2905 (patch) | |
tree | 238ff2d1955fdb0ee6562a7a822217299a20dde4 /CMakeLists.txt | |
parent | 3b276deb9b52ba8c667c12379c39dc46ea375609 (diff) | |
download | ouroboros-af3d6479ddbfe995b0ae8bb1488e8756e32c2905.tar.gz ouroboros-af3d6479ddbfe995b0ae8bb1488e8756e32c2905.zip |
build: Set compiler optimization for release build
This automatically sets the -O3 compiler flag for release builds.
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 07ef897c..f23925fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,9 @@ test_and_set_c_compiler_flag_global(-Wstrict-prototypes) test_and_set_c_compiler_flag_global(-Wunreachable-code) test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement) test_and_set_c_compiler_flag_global(-fmax-errors=5) +if (CMAKE_BUILD_TYPE STREQUAL "Release") + test_and_set_c_compiler_flag_global(-O3) +endif () configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros-dev.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/ouroboros-dev.pc" @ONLY) |