Skip to content

Commit

Permalink
Fix nasa#2320, reorganize FS header files
Browse files Browse the repository at this point in the history
Organize FS header file contents according to the convention
  • Loading branch information
jphickey committed May 3, 2023
1 parent 8f4d8d9 commit e63a5ea
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,6 @@
#ifndef CFE_FS_EXTERN_TYPEDEFS_H
#define CFE_FS_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_fs_eds_typedefs.h"

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

#include "common_types.h"

/******************* Macro Definitions ***********************/
Expand Down Expand Up @@ -217,6 +207,4 @@ typedef struct CFE_FS_Header
char Description[CFE_FS_HDR_DESC_MAX_LEN]; /**< \brief File description */
} CFE_FS_Header_t;

#endif /* CFE_EDS_ENABLED_BUILD */

#endif /* CFE_FS_EXTERN_TYPEDEFS_H */
37 changes: 37 additions & 0 deletions modules/fs/mission_build.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
###########################################################
#
# FS Core Module mission 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 FS configuration
set(FS_MISSION_CONFIG_FILE_LIST
cfe_fs_extern_typedefs.h
)

if (CFE_EDS_ENABLED_BUILD)

# In an EDS-based build, these files come generated from the EDS tool
set(FS_CFGFILE_SRC_fs_extern_typedefs "cfe_fs_eds_typedefs.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(FS_CFGFILE ${FS_MISSION_CONFIG_FILE_LIST})
get_filename_component(CFGKEY "${FS_CFGFILE}" NAME_WE)
if (DEFINED FS_CFGFILE_SRC_${CFGKEY})
set(DEFAULT_SOURCE GENERATED_FILE "${FS_CFGFILE_SRC_${CFGKEY}}")
else()
set(DEFAULT_SOURCE FALLBACK_FILE "${CMAKE_CURRENT_LIST_DIR}/config/default_${FS_CFGFILE}")
endif()
generate_config_includefile(
FILE_NAME "${FS_CFGFILE}"
${DEFAULT_SOURCE}
)
endforeach()

0 comments on commit e63a5ea

Please sign in to comment.