-
Notifications
You must be signed in to change notification settings - Fork 201
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
Refactor "target_config.c" logic to avoid #include of data fragments #1170
Comments
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Feb 17, 2021
Rework the dynamic content so it is generated entirely via a CMake "configure_file()" command into a C source file (.c) that can be built as normal. This removes the need for inline `#include` statements to pull in data fragments to fill in the data.
This was referenced Feb 17, 2021
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Feb 18, 2021
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Feb 26, 2021
Rework the dynamic content so it is generated entirely via a CMake "configure_file()" command into a C source file (.c) that can be built as normal. This removes the need for inline `#include` statements to pull in data fragments to fill in the data.
jphickey
added a commit
to jphickey/cFE
that referenced
this issue
Mar 3, 2021
Rework the dynamic content so it is generated entirely via a CMake "configure_file()" command into a C source file (.c) that can be built as normal. This removes the need for inline `#include` statements to pull in data fragments to fill in the data.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
The content of the various CONFIGDATA global data structures is dynamically generated from a combination of build scripts, some which run at prep/generation time and some which run at build time.
The pattern currently used here is that the scripts generate "fragment" data files that only contain the dynamic content, without any C declarations or any other syntax. This is then paired/combined with the
target_config.c
file which is a regular version-controlled file that has the basic structure and declarations (i.e. all the non-dynamic bits) and uses#include
to pull in the data fragments where needed (i.e. a "fill-in-the-blank" approach).This works well but there are some rules against using the
#include
directive with anything other than an normal/conventional fully formed C header file (i.e. it has.h
extension, fully self contained, syntactically correct, standalone, include-able by any C source file at will). So a "dynamic data fragment" file which is implemented here doesn't meet the criteria.Describe the solution you'd like
Have the build system generate fully-formed source files before passing to C compiler in some way.
Currently evaluating/considering several approaches or combination thereof.
configure_file
templates, generating a separate but fully-resolved .c source for each object that has dynamic content.Either way the result should be a fully formed .c/.h file without any
#include
in its body - as all data items should be "filled in" already - which is then built and linked as the current file is.Requester Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: