From b6bc7f44c216c0bebade467f215d41ea685b15ac Mon Sep 17 00:00:00 2001 From: Simon Rohou Date: Wed, 6 Nov 2024 11:42:54 +0100 Subject: [PATCH] [cmake] corrected FAST_RELEASE config (closes #128) --- CMakeLists.txt | 3 ++- examples/01_batman/CMakeLists.txt | 5 +++++ examples/02_centered_form/CMakeLists.txt | 5 +++++ examples/03_sivia/CMakeLists.txt | 5 +++++ src/core/tools/codac2_assert.h | 2 +- 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f25b75d8..33f7debf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,7 +114,8 @@ ################################################################################ if(FAST_RELEASE) - add_compile_definitions(FAST_RELEASE=1) + add_compile_definitions(FAST_RELEASE) + message(STATUS "You are running Codac in fast release mode. (option -DCMAKE_BUILD_TYPE=Release is required)") endif() add_subdirectory(src) # C++ sources diff --git a/examples/01_batman/CMakeLists.txt b/examples/01_batman/CMakeLists.txt index ce2e8a92..3c62a678 100644 --- a/examples/01_batman/CMakeLists.txt +++ b/examples/01_batman/CMakeLists.txt @@ -38,6 +38,11 @@ # Compilation + if(FAST_RELEASE) + add_compile_definitions(FAST_RELEASE) + message(STATUS "You are running Codac in fast release mode. (option -DCMAKE_BUILD_TYPE=Release is required)") + endif() + add_executable(${PROJECT_NAME} main.cpp) target_compile_options(${PROJECT_NAME} PUBLIC ${CODAC_CXX_FLAGS}) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CODAC_INCLUDE_DIRS}) diff --git a/examples/02_centered_form/CMakeLists.txt b/examples/02_centered_form/CMakeLists.txt index ce2e8a92..3c62a678 100644 --- a/examples/02_centered_form/CMakeLists.txt +++ b/examples/02_centered_form/CMakeLists.txt @@ -38,6 +38,11 @@ # Compilation + if(FAST_RELEASE) + add_compile_definitions(FAST_RELEASE) + message(STATUS "You are running Codac in fast release mode. (option -DCMAKE_BUILD_TYPE=Release is required)") + endif() + add_executable(${PROJECT_NAME} main.cpp) target_compile_options(${PROJECT_NAME} PUBLIC ${CODAC_CXX_FLAGS}) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CODAC_INCLUDE_DIRS}) diff --git a/examples/03_sivia/CMakeLists.txt b/examples/03_sivia/CMakeLists.txt index ce2e8a92..3c62a678 100644 --- a/examples/03_sivia/CMakeLists.txt +++ b/examples/03_sivia/CMakeLists.txt @@ -38,6 +38,11 @@ # Compilation + if(FAST_RELEASE) + add_compile_definitions(FAST_RELEASE) + message(STATUS "You are running Codac in fast release mode. (option -DCMAKE_BUILD_TYPE=Release is required)") + endif() + add_executable(${PROJECT_NAME} main.cpp) target_compile_options(${PROJECT_NAME} PUBLIC ${CODAC_CXX_FLAGS}) target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC ${CODAC_INCLUDE_DIRS}) diff --git a/src/core/tools/codac2_assert.h b/src/core/tools/codac2_assert.h index 7c68dd64..c054a228 100644 --- a/src/core/tools/codac2_assert.h +++ b/src/core/tools/codac2_assert.h @@ -18,7 +18,7 @@ namespace codac2 { #if defined FAST_RELEASE & defined NDEBUG - #define assert_release(ignore_test,ignore_message) ((void)0) + #define assert_release(ignore_test) ((void)0) #else