From af3d6479ddbfe995b0ae8bb1488e8756e32c2905 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 11 Nov 2017 10:33:04 +0100 Subject: build: Set compiler optimization for release build This automatically sets the -O3 compiler flag for release builds. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) 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) -- cgit v1.2.3