diff --git a/cmake/sample_defs/targets.cmake b/cmake/sample_defs/targets.cmake index 03d72f454..49c26c7a4 100644 --- a/cmake/sample_defs/targets.cmake +++ b/cmake/sample_defs/targets.cmake @@ -98,3 +98,28 @@ SET(TGT1_FILELIST cfe_es_startup.scr) #SET(TGT3_APPLIST sample_app ci_lab to_lab sch_lab) #SET(TGT3_FILELIST cfe_es_startup.scr) +# Cache related environment variables +# NOTE - requires distclean and re-"make prep" to change +set(STRICT_NO_WARNINGS $ENV{STRICT_NO_WARNINGS} CACHE STRING "Enable strict warnings and Werror") +set(OMIT_DEPRECATED $ENV{OMIT_DEPRECATED} CACHE STRING "Omit deperecated elements") + +# Helper definition to abstract strict compiler flags and +# treat warnings as errors. Settings are not appropriate for every build +# environment/target, targeted for CI and as an example set. +if (STRICT_NO_WARNINGS) + message (STATUS "STRICT_NO_WARNINGS=true: Enforcing strict warnings and Werror") + add_definitions(-Wall -Werror -std=c99 -D_XOPEN_SOURCE=600 -pedantic -Wstrict-prototypes -Wcast-align -Wwrite-strings) +else() + message (STATUS "STRICT_NO_WARNINGS=false: Not enforced") +endif (STRICT_NO_WARNINGS) + +# Helper definition to abstract omitting deprecated elements, +# allows for one setting in CI and used by projects +if (OMIT_DEPRECATED) + message (STATUS "OMIT_DEPRECATED=true: Not including deprecated elements in build") + add_definitions(-DCFE_OMIT_DEPRECATED_6_6 -DOSAL_OMIT_DEPRECATED) +else() + message (STATUS "OMIT_DEPRECATED=false: Deprecated elements included in build") +endif (OMIT_DEPRECATED) + +