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

add_cfe_app uses deprecated call to target_link_libraries #2141

Open
irowebbn opened this issue Sep 9, 2022 · 0 comments
Open

add_cfe_app uses deprecated call to target_link_libraries #2141

irowebbn opened this issue Sep 9, 2022 · 0 comments

Comments

@irowebbn
Copy link
Contributor

irowebbn commented Sep 9, 2022

target_link_libraries(${APP_NAME} core_api)

Describe the issue.

The CMake linking directive in arch_build.cmake uses the "plain" signature (ie, does not use a PRIVATE, PUBLIC, or INTERFACE keyword to specify how a library is used by a target's dependents). Because of this, one cannot use the keyword-style call on a cFS app without triggering a CMake warning. Mixing the plain and keyword styles has been deprecated since CMake 2.8.12. Since cFE specifies a minimum cMake version of 3.5, this should be updated.

As far as I can tell, calling target_link_libraries in an app to link in a static library is necessary, because this is not done as part of add_cfe_app_dependency.

Describe the expected behavior if the bug did not occur.

target_link_libraries directives could be used with keyword signatures in app CMakelists files, and no deprecation warning emitted.

Provide the reproduction steps that someone else can follow to recreate the bug or error on their own.

  • Create a static library (either manually via CMake or by putting the target name in <CPU>_STATIC_APPLIST and using add_cfe_app.
  • Add the library as a dependency for an app (either manually via CMake or by using add_cfe_app_dependency)
  • Try to link it in an app using target_link_libraries(<app_name> <PRIVATE|PUBLIC|INTERFACE> <lib_name>)
  • Build as usual

If applicable, add code snippets or references to the software.

target_link_libraries(${APP_NAME} core_api)

Provide the system the bug was observed on.
I'm using the cFE v7.0.0-rc4 release https://github.com/nasa/cFE/releases/tag/v7.0.0-rc4, but this is present in main and draco-rc4 at the time of reporting. CMake verison is 3.23.0-rc2.

Provide any additional context if applicable.

See CMake policy CMP0023.

Isaac Rowe, Jacobs contractor to NASA JSC

(edited to provide information requested by contributor guidelines)

@irowebbn irowebbn changed the title add_cfe_app uses deprecated call to target_link_librareis add_cfe_app uses deprecated call to target_link_libraries Sep 9, 2022
skliper added a commit to skliper/cFE that referenced this issue Sep 9, 2022
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