-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: fix application config #13799
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: fix application config #13799
Conversation
These settings like enable_language should be done in the application and just once. We hit the issue when you expose sources to an app (interface or public), CMake errors as some of the internal settings have not been configured.
@0xc0170, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try this with a modified Blinky application? If so, can you provide a link to the branch you used? With what I showed you before, I also had to call everything except for enable language in Mbed OS.
Yes, the only change in the app to do is to add Please test with your minimal blinky. I tested .S files being added to the app, no error given(the only error you get if you use public for a file that is part of Mbed OS, as it would be copied to an app as well - duplicated symbols errors then). |
I ported your changes to https://github.com/hugueskamba/mbed-os/tree/hk_cmake_mbed-os-rtos and used it with https://github.com/hugueskamba/mbed-os-example-blinky/tree/hk_cmake_mbed-os-rtos. I had to do the following in the app: target_link_libraries(${APP_TARGET}
PRIVATE
mbed-os
INTERFACE
mbed-os-rtos
) Other wise I get duplicated symbols because I am guessing some are weak symbols and they are both included instead of selecting just the strong one.
|
Waiting until we get the name fixing in the CMake, and lets see what we need |
I have this PR for Blinky: ARMmbed/mbed-os-example-blinky#244 |
Summary of changes
These settings like enable_language should be done in the application and just once.
We hit the issue when you expose sources to an app (interface or public), CMake errors as some of the internal settings have not been configured.
From the CMake docs for enable_language:
This is why it should be in the top project (application). Not mbed-os target as it was previously. We found some issue with the previous setup.
There might be another way to fix it, open for discussion.
The bareminimum would be in the app
enable_language(C CXX ASM)
. However this setup compilers and there should be properly set up via cmake toolchain file (or not?).Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers