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

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
13 changes: 10 additions & 3 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ macro(define X)
endif(DEFINED ${X})
endmacro()

macro(defineString X)
erlingrj marked this conversation as resolved.
Show resolved Hide resolved
if(DEFINED ${X})
message(STATUS ${X}=\"${${X}}\")
target_compile_definitions(reactor-c PUBLIC ${X}=\"${${X}}\")
endif(DEFINED ${X})
endmacro()

# Search and apply all possible compile definitions
message(STATUS "Applying preprocessor definitions...")
define(_LF_CLOCK_SYNC_ATTENUATION)
Expand All @@ -178,9 +185,9 @@ define(NUMBER_OF_WORKERS)
define(NUMBER_OF_WATCHDOGS)
define(USER_THREADS)
define(SCHEDULER)
define(LF_SOURCE_DIRECTORY)
define(LF_SOURCE_GEN_DIRECTORY)
define(LF_PACKAGE_DIRECTORY)
define(LF_FILE_SEPARATOR)
define(WORKERS_NEEDED_FOR_FEDERATE)
define(LF_ENCLAVES)
defineString(LF_SOURCE_DIRECTORY)
defineString(LF_SOURCE_GEN_DIRECTORY)
defineString(LF_PACKAGE_DIRECTORY)
2 changes: 1 addition & 1 deletion lingua-franca-ref.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
master
cmake-init-include
Copy link
Contributor

Choose a reason for hiding this comment

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

Reset to master when merging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes!

Loading