Skip to content

Commit

Permalink
Fix nasa#2320, reorganize TBL header files
Browse files Browse the repository at this point in the history
Organize TBL header file contents according to the convention
  • Loading branch information
jphickey committed May 3, 2023
1 parent 86cbe6a commit cec6e36
Show file tree
Hide file tree
Showing 13 changed files with 1,145 additions and 463 deletions.
39 changes: 39 additions & 0 deletions modules/tbl/arch_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
###########################################################
#
# TBL Core Module platform build setup
#
# This file is evaluated as part of the "prepare" stage
# and can be used to set up prerequisites for the build,
# such as generating header files
#
###########################################################

# The list of header files that control the TBL configuration
set(TBL_PLATFORM_CONFIG_FILE_LIST
cfe_tbl_internal_cfg.h
cfe_tbl_msgids.h
cfe_tbl_platform_cfg.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, msgids come generated from the EDS tool
set(TBL_CFGFILE_SRC_tbl_msgids "${CMAKE_CURRENT_LIST_DIR}/config/cfe_tbl_eds_msg_topicids.h")

endif(CFE_EDS_ENABLED_BUILD)

# Create wrappers around the all the config header files
# This makes them individually overridable by the missions, without modifying
# the distribution default copies
foreach(TBL_CFGFILE ${TBL_PLATFORM_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${TBL_CFGFILE}" NAME_WE)
if (DEFINED TBL_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE "${TBL_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE "${CMAKE_CURRENT_LIST_DIR}/config/default_${TBL_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${TBL_CFGFILE}"
FALLBACK_FILE ${DEFAULT_SOURCE}
)
endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
#ifndef CFE_TBL_EXTERN_TYPEDEFS_H
#define CFE_TBL_EXTERN_TYPEDEFS_H

/* This header may be generated from an EDS file,
* tools are available and the feature is enabled */
#ifdef CFE_EDS_ENABLED_BUILD

/* Use the EDS generated version of these types */
#include "cfe_tbl_eds_typedefs.h"

#else
/* Use the local definitions of these types */

#include "common_types.h"
#include "cfe_es_extern_typedefs.h"
#include "cfe_mission_cfg.h" /* for CFE_MISSION_TBL_MAX_FULL_NAME_LEN */
Expand Down Expand Up @@ -79,6 +69,4 @@ typedef struct CFE_TBL_File_Hdr
char TableName[CFE_MISSION_TBL_MAX_FULL_NAME_LEN]; /**< Fully qualified name of table to load */
} CFE_TBL_File_Hdr_t;

#endif /* CFE_EDS_ENABLED_BUILD */

#endif /* CFE_TBL_EXTERN_TYPEDEFS_H */
Loading

0 comments on commit cec6e36

Please sign in to comment.