-
Notifications
You must be signed in to change notification settings - Fork 64
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 cmake-init-include target property #2432
base: master
Are you sure you want to change the base?
Conversation
The change to |
Hi Edward, thanks for your feedback. The problem you identify is solved with the companion PR here: lf-lang/reactor-c#494 It adds back the quotation marks when they are defined as compiler flags. So the change is subtle, basically it only means that the CMake variable does not have the quotation marks and can thus conveniently be used in the |
f708f10
to
5393d17
Compare
@edwardalee I propose we merge this. Especially the changes to the CMake variables are very useful. |
This PR adds a new target property called
cmake-init-include
(I am open to other naming suggestions). You can pass it a list of paths to cmake files, which will be included in the generated CMakeLists.txt at the very beginning, before theproject(
statement.I am also removing the quotation marks on the LF_SOURCE_DIRECTORY compile def. The quotation mark makes it awkward to use it in the included cmake files, which is where they are likely to be used the most.
This means that the user can override the TOOLCHAIN_FILE cmake variable and can easily set up cross-compilation.
This PR enables STM32F4 support without piling on more platform and build logic into lfc but instead requiring the user to configure CMake correctly and add the right paths, compile defs and options.
In this PR I use the target property to enable cross compiling for STM32: lf-lang/stm32-nucleo-f446re-template#1
This PR is blocking #2185