diff --git a/examples/flexpret/CMakeLists.txt b/examples/flexpret/CMakeLists.txt index da9a2334..e2ae08f5 100644 --- a/examples/flexpret/CMakeLists.txt +++ b/examples/flexpret/CMakeLists.txt @@ -14,7 +14,7 @@ project(fp-lf) include(src-gen/Smoke/CMakeLists.txt) add_subdirectory(${REACTOR_UC_PATH}) -add_executable(fp-smoke main.c ${LF_SOURCES_ABSOLUTE}) +add_executable(fp-smoke main.c ${LF_SOURCES}) target_link_libraries(fp-smoke PUBLIC reactor-uc) target_include_directories(fp-smoke PRIVATE ${LF_INCLUDE_DIRS}) diff --git a/examples/zephyr/hello_lf/CMakeLists.txt b/examples/zephyr/hello_lf/CMakeLists.txt index 0eb7add0..0fba35c1 100644 --- a/examples/zephyr/hello_lf/CMakeLists.txt +++ b/examples/zephyr/hello_lf/CMakeLists.txt @@ -6,6 +6,6 @@ set(PLATFORM "ZEPHYR" CACHE STRING "Set platform to Zephyr") include(src-gen/HelloLF/CMakeLists.txt) add_subdirectory(${REACTOR_UC_PATH}) -target_sources(app PRIVATE main.c ${LF_SOURCES_ABSOLUTE}) +target_sources(app PRIVATE main.c ${LF_SOURCES}) target_link_libraries(app PRIVATE reactor-uc) target_include_directories(app PRIVATE ${LF_INCLUDE_DIRS}) diff --git a/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcCmakeGenerator.kt b/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcCmakeGenerator.kt index f567a23a..8c93a3fb 100644 --- a/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcCmakeGenerator.kt +++ b/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcCmakeGenerator.kt @@ -20,7 +20,6 @@ import java.time.LocalDateTime class UcCmakeGenerator(private val main: Reactor, private val targetConfig: TargetConfig, private val fileConfig: FileConfig) { private val S = '$' // a little trick to escape the dollar sign with $S private val platform = targetConfig.get(PlatformProperty.INSTANCE).platform - private val platformName = if (platform == PlatformType.Platform.AUTO) "POSIX" else platform.name.uppercase() fun generateCmake(sources: List) = if (platform == PlatformType.Platform.AUTO) { @@ -31,12 +30,10 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ fun generateCmakeEmbedded(sources: List) = with(PrependOperator) { """ - |# This is a generated CMakeLists file for ${fileConfig.name} at ${LocalDateTime.now()} + |# This file is generated by LFC. It is meant to be included in + |# an existing CMake project. | - |set(LF_SOURCES_RELATIVE - ${" | "..sources.joinWithLn { it.toUnixString() }} - |) - |set(LF_SOURCES_ABSOLUTE + |set(LF_SOURCES ${" | "..sources.joinWithLn { "$S{CMAKE_CURRENT_LIST_DIR}/${it.toUnixString()}"}} |) |set(REACTOR_UC_PATH $S{CMAKE_CURRENT_LIST_DIR}/reactor-uc) @@ -51,7 +48,7 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ """ |cmake_minimum_required(VERSION 3.5) |project(${fileConfig.name} VERSION 0.0.0 LANGUAGES C) - |set(PLATFORM $platformName CACHE STRING "Target platform") + |set(PLATFORM POSIX CACHE STRING "Target platform") |set(REACTION_QUEUE_SIZE ${main.getReactionQueueSize()} CACHE STRING "Size of the reaction queue") |set(EVENT_QUEUE_SIZE ${main.getEventQueueSize()} CACHE STRING "Size of the event queue") | @@ -66,7 +63,8 @@ class UcCmakeGenerator(private val main: Reactor, private val targetConfig: Targ |) | |add_subdirectory(reactor-uc) - |target_link_libraries($S{LF_MAIN_TARGET} PUBLIC reactor-uc) + |target_link_libraries($S{LF_MAIN_TARGET} PRIVATE reactor-uc) + |target_include_directories($S{LF_MAIN_TARGET} PRIVATE $S{CMAKE_CURRENT_LIST_DIR}) | """.trimMargin() } diff --git a/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcMakeGenerator.kt b/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcMakeGenerator.kt index a17af4ad..e4366457 100644 --- a/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcMakeGenerator.kt +++ b/lfc/core/src/main/kotlin/org/lflang/generator/uc/UcMakeGenerator.kt @@ -16,8 +16,8 @@ class UcMakeGenerator(private val main: Reactor, private val targetConfig: Targe private val S = '$' // a little trick to escape the dollar sign with $S fun generateMake(sources: List) = with(PrependOperator) { """ - | # Makefile genrated for ${fileConfig.name} at ${LocalDateTime.now()} - |LF_SOURCES_RELATIVE = \ + | # Makefile genrated for ${fileConfig.name} + |LF_SOURCES = \ ${" | "..sources.joinWithLn { it.toUnixString() + " \\ "}} |REACTION_QUEUE_SIZE = ${main.getReactionQueueSize()} |EVENT_QUEUE_SIZE = ${main.getEventQueueSize()} diff --git a/src/platform/flexpret/flexpret.c b/src/platform/flexpret/flexpret.c index f81e5000..4bc771af 100644 --- a/src/platform/flexpret/flexpret.c +++ b/src/platform/flexpret/flexpret.c @@ -99,7 +99,7 @@ void Platform_ctor(Platform *self) { self->leave_critical_section = PlatformFlexpret_leave_critical_section; self->get_physical_time = PlatformFlexpret_get_physical_time; self->wait_until = PlatformFlexpret_wait_until; - self->wait_until = PlatformFlexpret_wait_for; + self->wait_for = PlatformFlexpret_wait_for; self->initialize = PlatformFlexpret_initialize; self->wait_until_interruptible = PlatformFlexpret_wait_until_interruptible; self->new_async_event = PlatformFlexpret_new_async_event;