Skip to content

Commit

Permalink
proper include system
Browse files Browse the repository at this point in the history
  • Loading branch information
tanneberger committed Nov 20, 2024
1 parent 4db43cb commit f89e0ad
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(BUILD_UNIT_TESTS OFF CACHE BOOL "Build unit tests")
set(TEST_COVERAGE OFF CACHE BOOL "Compute test coverage")
set(ASAN OFF CACHE BOOL "Compile with AddressSanitizer")
set(PLATFORM "POSIX" CACHE STRING "Platform to target")
set(SCHEDULER "DYNAMIC" CACHE STRING "Scheduler to use")
set(EVENT_QUEUE_SIZE 32 CACHE STRING "Static size of the event queue")
set(REACTION_QUEUE_SIZE 32 CACHE STRING "Static size of the reaction queue")
set(NETWORK_CHANNEL_TCP_POSIX OFF CACHE BOOL "Use POSIX TCP NetworkChannel")
Expand Down Expand Up @@ -68,9 +69,13 @@ else ()
message(FATAL_ERROR "No valid platform specified")
endif ()


# Add compile definitions for platform and network channel specifics.
target_compile_definitions(reactor-uc PRIVATE "PLATFORM_${PLATFORM}")

# Add compile definition for scheduler used
target_compile_definitions(reactor-uc PRIVATE "SCHEDULER_${SCHEDULER}")

# Add compile definitions for event and reaction queue sizes. Has to be PUBLIC because they are used in the header files.
target_compile_definitions(reactor-uc PUBLIC EVENT_QUEUE_SIZE=${EVENT_QUEUE_SIZE})
target_compile_definitions(reactor-uc PUBLIC REACTION_QUEUE_SIZE=${REACTION_QUEUE_SIZE})
Expand Down
8 changes: 0 additions & 8 deletions include/reactor-uc/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,4 @@ struct Scheduler {
tag_t (*current_tag)(Scheduler *self);
};

#define SCHEDULER_DYNAMIC

#if defined(SCHEDULER_DYNAMIC)
#include "schedulers/dynamic/scheduler.h"
#else
#include "schedulers/static/scheduler.h"
#endif

#endif
9 changes: 7 additions & 2 deletions src/scheduler.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

#include "schedulers/static/instructions.c"
#include "schedulers/dynamic/dynamic.c"

#if defined(SCHEDULER_DYNAMIC)
#include "./schedulers/dynamic/scheduler.c"
#elif defined(SCHEDULER_STATIC)
#include "schedulers/static/scheduler.c"
#include "schedulers/static/instructions.c"
#else
#endif
File renamed without changes.

0 comments on commit f89e0ad

Please sign in to comment.