diff --git a/CMakeLists.txt b/CMakeLists.txt index d43a4c20c..f24717397 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,9 +43,13 @@ option(EVEREST_ENABLE_RUN_SCRIPT_GENERATION "Enables the generation of run scrip option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF) option(BUILD_TESTING "Build unit tests, used if standalone project" OFF) option(EVEREST_ENABLE_COMPILE_WARNINGS "Enable compile warnings set in the EVEREST_COMPILE_OPTIONS flag" OFF) +option(EVEREST_ENABLE_GLOBAL_COMPILE_WARNINGS "Enable compile warnings set in the EVEREST_COMPILE_OPTIONS flag globally" OFF) # list of compile options that are passed to modules if EVEREST_ENABLE_COMPILE_WARNINGS=ON # generated code has functions often not used set(EVEREST_COMPILE_OPTIONS "-Wall;-Wno-unused-function" CACHE STRING "A list of compile options used for building modules") +if(EVEREST_ENABLE_GLOBAL_COMPILE_WARNINGS) + add_compile_options(${EVEREST_COMPILE_OPTIONS}) +endif() if((${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME} OR ${PROJECT_NAME}_BUILD_TESTING) AND BUILD_TESTING) set(EVEREST_CORE_BUILD_TESTING ON) endif()