Closed ghost closed 1 year ago
Could also consider for unmatched compilers if the START_WHOLE_ARCHIVE and STOP_WHOLE_ARCHIVE cmake variables aren't set throw an error with a notification that these should be set from your toolchain file (or update the default processing).
Good idea - it would be nice to not require someone to hunt this down again.
Is your feature request related to a problem? Please describe. In the target CMakeLists.txt file, there is logic that conditionally adds the --whole-archive linker options. This logic currently checks for a compiler ID of "GNU". When using a VxWorks 7 toolchain that is based on Clang, this logic is not triggered.
Describe the solution you'd like Adjust the logic to allow for Clang based toolchains. The vxWorks toolchain has compatible options so only the toolchain identification needs to be changed.
Describe alternatives you've considered We could move these flags into the toolchain files, but that would require changing all existing toolchain files.
Additional context The current logic is here: https://github.com/nasa/cFE/blob/main/cmake/target/CMakeLists.txt#L159
The new logic needs to look something like this: if (("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
Requester Info Alan Cudmore, NASA/GSFC Code 582.0
NOTE: This change is likely to be part of a set of changes to support vxWorks 7.0