Skip to content

Stringify CMake command-line arguments before they are added as compile definitions#494

Merged
edwardalee merged 13 commits into
mainfrom
cmake-init-include
Jun 8, 2025
Merged

Stringify CMake command-line arguments before they are added as compile definitions#494
edwardalee merged 13 commits into
mainfrom
cmake-init-include

Conversation

@erlingrj
Copy link
Copy Markdown
Collaborator

@erlingrj erlingrj commented Nov 6, 2024

Needed for: lf-lang/lingua-franca#2432

The paths to the source directory, binary directory and src-gen directory are passed to CMake as command line arguments. They are originally passed as strings using quotation marks. In the LF change linked I remove the quotation marks because it means you cannot easily use them in CMake. I think these paths are most useful for the user when he adds a cmake-include.

So in this PR I add quotation marks to the paths before they are made into compile definitions so that they conveniently can be used in the user C code as well.

@erlingrj erlingrj added the enhancement Enhancement of existing feature label Nov 6, 2024
@erlingrj erlingrj requested a review from edwardalee November 6, 2024 06:07
@erlingrj erlingrj changed the title Add utility macro to stringify a macro Stringify CMake command-line arguments before they are added as compile definitions Nov 11, 2024
Copy link
Copy Markdown
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread core/CMakeLists.txt
Comment thread lingua-franca-ref.txt Outdated
@edwardalee edwardalee added this pull request to the merge queue Jun 8, 2025
Merged via the queue into main with commit cf1d40a Jun 8, 2025
111 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants