Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cFS-Caelum Review, CFS-40: ES, Resource ID, core api and private, and build system #1283

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Ignore everything
*

# ...even if they are in subdirectories
!*/

# But not these files...
!/.gitignore


# Build Files
!cmake/**/target_config.*
!cmake/target/CMAKELists.txt
!cmake/arch_build.cmake
!cmake/cfe_generated_file.h.in
!cmake/check_header.c.in
!cmake/generate_build_env.cmake
!cmake/generate_git_module_version.cmake
!cmake/global_functions.cmake
!cmake/mission_build.cmake
!cmake/mission_defaults.cmake

!/CMakeLists.txt

# cFE-Core
!modules/core_api/fsw/inc/cfe.h
!modules/core_api/fsw/inc/cfe_endian.h
!modules/core_api/fsw/inc/cfe_error.h
!modules/core_api/fsw/inc/cfe_version.h

# ES
!modules/core_api/fsw/inc/cfe_es*
!modules/core_private/fsw/inc/cfe_es*

!modules/es/fsw/**

!modules/es/CMakeLists.txt


# ResourceID

!modules/core_api/fsw/inc/cfe_resourceid*

!modules/core_private/fsw/inc/cfe_core_resourceid_basevalues.h

!modules/resourceid/fsw/src/*
!modules/resourceid/option_inc/*
!modules/resourceid/CMakeLists.txt
!modules/resourceid/mission_build.cmake
126 changes: 126 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
##########################################################################
#
# Core Flight Software Mission top-level CMake build script
# This will build cFS for all target machine(s) defined by the mission
#
# Note that the target CPUs may use different architectures, therefore each
# architecture must be done as a separate sub-build since none of the binaries
# can be shared.
#
# This is actually two build scripts in one:
# - A "top-level" script which divides the overall build by architecture
# (This is run when TARGETSYSTEM is unset)
# - An architecture-specific build that generates the binaries
# (This is run when TARGETSYSTEM is set)
#
# This file implements the common operation sequence between the mission build
# and the architecture-specific sub build. It relies on several functions
# that are implemented in a separate include files:
#
# initialize_globals:
# This function sets up the basic global variables such as MISSION_SOURCE_DIR,
# MISSIONCONFIG, ENABLE_UNIT_TESTS, SIMULATION and others. These are the
# basic variables that must exist _before_ the mission configuration is read.
#
# read_targetconfig:
# Parse the information from targets.cmake and create the build lists. Note
# this function is common to both mission and arch-specific builds.
#
# prepare:
# Use the information in the target config to set up additional variables
# and satisfy any preequisites for targets. Most importantly this stage
# is reposible for finding the actual location of all source files for apps
# listed in the mission configuration, along with collecting any supplemental
# sources, such as EDS files or additional compiler flags.
#
# process_arch:
# This is called multiple times, once for each CPU architecture specfied in
# the main targets.cmake file. At the mission level, this creates a sub
# project target using the correct toolchain for cross compile. In the arch
# specific level (inside the sub-project) it generates the actual library and
# executable targets.
#
#
##########################################################################

# Squelch a warning when building on Win32/Cygwin
set(CMAKE_LEGACY_CYGWIN_WIN32 0)

# Add a path for any locally-supplied CMake modules
# These would typically be a part of any custom PSPs in use.
# (this is not required, and the directory can be empty/nonexistent)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../psp/cmake/Modules" ${CMAKE_MODULE_PATH})

# The minimum CMake version is chosen because v3.5.1 is what is
# available by default with Ubuntu 16.04 LTS at the time of development
# RHEL/CentOS users should install the "cmake3" package from EPEL repo
cmake_minimum_required(VERSION 3.5)

# This top-level file does not define ANY targets directly but we know
# that the subdirectories will at least use the "C" language, so
# indicate that now. Doing this early initializes the CFLAGS
# so they won't change later.
# Note: this line defines the CFE_SOURCE_DIR variable.
project(CFE C)

# Allow unit tests to be added by any recipe
enable_testing()

# Include the global routines
include("cmake/global_functions.cmake")

# Load a sub-script that defines the other functions,
# depending on whether TARGETSYSTEM is defined or not
if (TARGETSYSTEM)
# Arch-specific/CPU build mode -- use the "arch_build" implementation
set(IS_CFS_ARCH_BUILD TRUE)
include("cmake/arch_build.cmake")
else (TARGETSYSTEM)
# Host System/Top Level build mode -- use the "mission_build" implementation
set(IS_CFS_MISSION_BUILD TRUE)
include("cmake/mission_build.cmake")
endif (TARGETSYSTEM)

# Call the initialization function defined by the sub-script
# This is implemented differently depending on whether this is a
# top-level or arch-specific build
initialize_globals()

# Load the target configuration information (used by all builds)
# This is at the top level so all vars set in here will become globals.
# The "defaults" file is included first, which the user-supplied targets
# file may override as necessary.
include("cmake/mission_defaults.cmake")
include(${MISSION_DEFS}/targets.cmake)

# Scan the list of targets and organize by target system type.
read_targetconfig()

# Include global-scope build customization
# Note if this feature is used it should only set basic options
# that have wide support (e.g. add_definitions). It should not
# set anything target or machine specific.
include("${MISSION_DEFS}/global_build_options.cmake" OPTIONAL)

# Additionally the target mission might require additional
# custom build steps or override some routines. In particular
# some architectures might need some special installation steps
# The custom script may override functions such as the
# cfe_exec_do_install() and cfe_app_do_install() functions for this
if (IS_CFS_ARCH_BUILD)
include("${MISSION_DEFS}/arch_build_custom.cmake" OPTIONAL)
include("${MISSION_DEFS}/arch_build_custom_${TARGETSYSTEM}.cmake" OPTIONAL)
elseif (IS_CFS_MISSION_BUILD)
include("${MISSION_DEFS}/mission_build_custom.cmake" OPTIONAL)
endif (IS_CFS_ARCH_BUILD)

# Call the prepare function defined by the sub-script
# This is implemented differently depending on whether this is a
# top-level or arch-specific build
prepare()

# Call the process_arch macro for each architecture
foreach(SYSVAR ${TGTSYS_LIST})
process_arch(${SYSVAR})
endforeach(SYSVAR IN LISTS TGTSYS_LIST)

24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# cFE
## cFS-Caelum Review: CFS-40

This branch is meant for the cFS-Caelum code review of cFE-Core, Executive Services (ES), ResourceID, and the CMake Build files. The review designation is "CFS-40"

The corresponding, fully working cFE instance matching the code in this branch can be found under the [cFE v7.0.0-rc1 tag](https://github.com/nasa/cFE/releases/tag/v7.0.0-rc1)

### How to add your review comments

Navigate to the ["files changed" tab](https://github.com/nasa/cFE/pull/1283/files) in the [nasa/cFE#1283](https://github.com/nasa/cFE/pull/1283) pull request.


<img width="820" alt="github-review-instructions-1of2" src="https://user-images.githubusercontent.com/59618057/113956688-dca76a00-97eb-11eb-99d4-9ec84b459dce.png">


You can add comments on any line of code by hovering on the line number and clicking on the plus "+" sign. Once you're finished with the comment click on the green "Start Review" button. To add more comments, just click on the relevant line number in any file, type your comment, and click on "Add review comment".


<img width="1229" alt="github-review-instructions-2of2" src="https://user-images.githubusercontent.com/59618057/113956482-8508fe80-97eb-11eb-8197-618d4e25fa51.png">

If you need to take a break, or if you're done, click the green "Finish Review" button on the top right corner of the
page, add any overall or summarizing comments and click on "Submit Review". You can always return and add new comments using the same process.

**Thank you!**
Loading