Commit 41e21b43 authored by David Frank's avatar David Frank
Browse files

Added compiler warnings

Added flag to turn on compiler warnings
parent e324db72
Pipeline #159193 passed with stages
in 1 minute and 40 seconds
......@@ -22,7 +22,7 @@ option(GIT_SUBMODULE "Check submodules during build" ${ELSA_MASTER_PROJECT})
option(ELSA_BUILD_EXAMPLES "Build examples" ${ELSA_MASTER_PROJECT})
option(ELSA_BUILD_CUDA_PROJECTORS "Attempts to build CUDA projectors if set" ON)
option(ELSA_BUILD_WITH_MORE_WARNINGS "Reduce noise of warnings, but make chaning fast and easy" OFF)
# ------------ general setup -----------
# ------------
......
......@@ -6,7 +6,6 @@ macro(registerComponent name)
set(ELSA_REGISTERED_COMPONENTS "${ELSA_REGISTERED_COMPONENTS};${name}" PARENT_SCOPE)
endmacro()
# add the elsa modules
add_subdirectory(core)
add_subdirectory(logging)
......@@ -22,5 +21,21 @@ endif(ELSA_BUILD_CUDA_PROJECTORS)
add_subdirectory(generators)
#---------------------------------------------------------------------------------------
# Turn on compiler warnings and sanitizers for all components on, if wanted
#---------------------------------------------------------------------------------------
if(${ELSA_MASTER_PROJECT} AND ${ELSA_BUILD_WITH_MORE_WARNINGS})
foreach (_component ${ELSA_REGISTERED_COMPONENTS})
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
target_compile_options( elsa_${_component} PUBLIC -Wall -Wextra -Wconversion -pedantic -Wfatal-errors)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
target_compile_options( elsa_${_component} PUBLIC /W3 /WX )
endif()
#include(cmake/sanitizers.cmake)
endforeach (_component ELSA_REGISTERED_COMPONENTS)
endif(${ELSA_MASTER_PROJECT} AND ${ELSA_BUILD_WITH_MORE_WARNINGS})
# propogate the variable to the parent scope
set(ELSA_REGISTERED_COMPONENTS "${ELSA_REGISTERED_COMPONENTS};" PARENT_SCOPE)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment