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 cmake-init-include target property #2432

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

erlingrj
Copy link
Collaborator

@erlingrj erlingrj commented Nov 5, 2024

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 the project( 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

@erlingrj erlingrj added enhancement Enhancement of existing feature c Related to C target cpp Related to C++ target build system cmake labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system c Related to C target cmake cpp Related to C++ target enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant