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

cmake(bugfix):remove no need target_link_library in static target #14757

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

xuxin930
Copy link
Contributor

Summary

the link_library of the static target will cause PRIVATE to be inherited to nuttx, resulting in duplicate linking and definition problems. because all target static libraries will eventually be linked, there is no need to specify it explicitly.

# if app2 target call target_link_library(app1)
# casue dup link be like
ld --start-group libapp1.a libapp2.a libarch.a libboard.a --end-group libapp1.a 

If the static definition exceeds the linker group, there is a risk of multiple definition errors.

Impact

should be compatible with all cmake build configurations

Testing

cmake -B build -DBOARD_CONFIG=qemu-armv7a:nsh

build pass

@github-actions github-actions bot added Area: Build system Size: XS The size of the change in this PR is very small labels Nov 13, 2024
@xuxin930
Copy link
Contributor Author

let me fix all apps compile failed first

the link_library of the static target will cause PRIVATE to be inherited to nuttx,
resulting in duplicate linking and definition problems.
because all target static libraries will eventually be linked, there is no need to specify it explicitly.

Signed-off-by: xuxin19 <[email protected]>
@xiaoxiang781216 xiaoxiang781216 merged commit 3ae822c into apache:master Nov 13, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Build system Size: XS The size of the change in this PR is very small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants