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

Propagate CMAKE_EXPORT_COMPILE_COMMANDS to CMake subprocess #2144

Closed
aliounis opened this issue Sep 13, 2022 · 0 comments
Closed

Propagate CMAKE_EXPORT_COMPILE_COMMANDS to CMake subprocess #2144

aliounis opened this issue Sep 13, 2022 · 0 comments
Milestone

Comments

@aliounis
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When building cFE alongside of other apps the setting for the CMake variable CMAKE_EXPORT_COMPILE_COMMANDS only applies to the efl2cfetbl target due to the architecture of the CMake build system for cFS. This makes it difficult for many development tools (like visual studio code) to properly understand the full cFE environment without putting in significant manual effort to specify the include paths and other compiler settings, thing which are usually captured in the compilation database built when CMAKE_EXPORT_COMPILE_COMMANDS is set to ON

Describe the solution you'd like
Ultimately this comes down to the subprocess call in mission_build.cmake (around line 438 in the current main branch) where the setting for CMAKE_EXPORT_COMPILE_COMMANDS is not propagated to the subprocess. The fix is as simple as adding this line

-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=${CMAKE_EXPORT_COMPILE_COMMANDS}

somewhere between ${CMAKE_COMMAND} and ${SELECTED_TOOLCHAIN_FILE}.

Describe alternatives you've considered
This is the simplelest and least disruptive to the existing build process. Alternatives would be to use ExternalProject or add_custom_command/add_custom_target which would probably play nicer than the execute_process, but they would also need to pass the same flag in this manor.

Additional context
N/A

Requester Info
Andrew Liounis, NASA/GSFC

aliounis added a commit to aliounis/cFE that referenced this issue Sep 13, 2022
Propagates variable CMAKE_EXPORT_COMPILE_COMANDS to the cmake subprocess in mission_build.cmake
@dzbaker dzbaker closed this as completed in 8d6f89c Oct 3, 2022
@dmknutsen dmknutsen added this to the Draco milestone Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants