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

fails to link imported libraries #3

Closed
bootchk opened this issue Jan 13, 2018 · 1 comment
Closed

fails to link imported libraries #3

bootchk opened this issue Jan 13, 2018 · 1 comment

Comments

@bootchk
Copy link

bootchk commented Jan 13, 2018

Redefinition of CMAKE_CXX_LINK_EXECUTABLE omits <LINK_LIBRARIES>. It should be:

set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_C_COMPILER} <LINK_FLAGS> -lstdc++ -o <LINK_LIBRARIES>")

For example, without it, this fails with undefined references at link time:

add_library(bar STATIC IMPORTED)
set_target_properties( bar PROPERTIES IMPORTED_LOCATION /home/bootch/git/radioSoC/Debug52/bar.a )
nRF5x_addExecutable(foo main.cpp)
target_link_libraries( foo bar)

apparently cmake enacts that via <LINK_LIBRARIES>.

Also, what happens if the scripts don't redefine at all (and as you say, CMAKE_C_FLAGS are added implicitly)? I guess I should try it and see how CMAKE_C_FLAGS disrupt the link.

@dariuszseweryn
Copy link

With the latest contributions the script is ready for SDK 15 and has the mentioned definition fixed.

I guess I can close this now (after a year...)

Anyway — thank you for the input!

borys-jelenski-polidea added a commit that referenced this issue Jun 15, 2020
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

No branches or pull requests

2 participants