Skip to content

Commit

Permalink
Fix #24 #355, Add compile flag abstractions
Browse files Browse the repository at this point in the history
Adds STRICT_NO_WARNINGS and OMIT_DEPRECATED
prep options for CI and as example build
  • Loading branch information
skliper committed Jan 8, 2020
1 parent 2b27dfc commit 28c6d80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmake/sample_defs/targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,21 @@ 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)

# Set host strict warnings, gets applied to all host compiled elements
# Note target strict warnings are defined in associated toolchain file
SET(HOST_STRICT_WARNINGS "-Wall -Werror -std=c99 -D_XOPEN_SOURCE=600 -pedantic -Wstrict-prototypes -Wcast-align -Wwrite-strings")

# Cache related environment variables
# NOTE - requires distclean and re-"make prep" to change
set(OMIT_DEPRECATED $ENV{OMIT_DEPRECATED} CACHE STRING "Omit deperecated elements")

# 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)


2 changes: 2 additions & 0 deletions cmake/sample_defs/toolchain-cpu1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ SET(CFE_SYSTEM_PSPNAME "pc-linux")
SET(OSAL_SYSTEM_BSPNAME "pc-linux")
SET(OSAL_SYSTEM_OSTYPE "posix")

# Define target strict warnings applied to all cross compiled code
SET(TARGET_STRICT_WARNINGS "-Wall -Werror -std=c99 -D_XOPEN_SOURCE=600 -pedantic -Wstrict-prototypes -Wcast-align -Wwrite-strings")

0 comments on commit 28c6d80

Please sign in to comment.