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

Does not build without feature test macro set externally #140

Open
irowebbn opened this issue Oct 24, 2023 · 0 comments
Open

Does not build without feature test macro set externally #140

irowebbn opened this issue Oct 24, 2023 · 0 comments

Comments

@irowebbn
Copy link

Describe the bug
There's a build dependency here with [cmake/sample_defs/mission_build_custom.cmake](https://github.com/nasa/cFE/blob/03166722cdde3f1b337742088e7137ebacf64734/cmake/sample_defs/mission_build_custom.cmake), which specifies a feature test macro. If a mission has a different and/or non-existent mission_build_custom.cmake, the compilation will fail for this target. It would be much better if the target specified its own requirements.

# The _XOPEN_SOURCE directive is required for glibc to enable conformance with the
# the X/Open standard version 6, which includes POSIX.1c as well as SUSv2/UNIX98 extensions.
add_definitions(
    -D_XOPEN_SOURCE=600
)

To Reproduce

  • Follow normal build instructions, but omit mission_build_custom.cmake from the <mission>_defs folder.
[ 50%] Building C object tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o
make[4]: Leaving directory `build'
[ 50%] Built target cfe-build-env
inside get_version for core_api
tools/elf2cfetbl/elf2cfetbl.c:99:18: error: ‘PATH_MAX’ undeclared here (not in a function)
 char SrcFilename[PATH_MAX] = {""};
                  ^
tools/elf2cfetbl/elf2cfetbl.c: In function ‘OpenSrcFile’:
tools/elf2cfetbl/elf2cfetbl.c:1427:13: warning: implicit declaration of function ‘ctime_r’ [-Wimplicit-function-declaration]
             printf("Original Source File Modification Time: %s\n", ctime_r(&SrcFileStats.st_mtime, TimeBuff));
             ^
make[4]: *** [tools/elf2cfetbl/CMakeFiles/elf2cfetbl.dir/elf2cfetbl.c.o] Error 1

Expected behavior
The target builds successfully.

System observed on:

  • OS: CentOS 7
  • cFE/OSAL/PSP: draco-rc3 bundle

Reporter Info
Isaac Rowe, NASA JSC, Jacobs Technology

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant