Skip to content

Commit

Permalink
samples: philosophers: evaluate variables coming from command line
Browse files Browse the repository at this point in the history
The variables passed by sanitycheck and west were being ignored because
cmake knows nothing about them.

Fixes zephyrproject-rtos#24178

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information
nashif authored and avisconti committed Apr 15, 2020
1 parent a3e7a13 commit d2a52b8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions samples/philosophers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,16 @@ cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(philosophers)

if(DEFINED DEBUG_PRINTF)
zephyr_compile_definitions(DEBUG_PRINTF)
endif()
if(DEFINED SAME_PRIO)
zephyr_compile_definitions(SAME_PRIO)
endif()
if(DEFINED STATIC_OBJS)
zephyr_compile_definitions(STATIC_OBJS)
endif()
if(DEFINED FORKS)
zephyr_compile_definitions(FORKS=${FORKS})
endif()
target_sources(app PRIVATE src/main.c)
10 changes: 10 additions & 0 deletions samples/portability/cmsis_rtos_v1/philosophers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@ cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(philosophers_cmsis_rtos_v1)

if(DEFINED DEBUG_PRINTF)
zephyr_compile_definitions(DEBUG_PRINTF)
endif()
if(DEFINED SAME_PRIO)
zephyr_compile_definitions(SAME_PRIO)
endif()
if(DEFINED FORKS)
zephyr_compile_definitions(FORKS=${FORKS})
endif()

target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/cmsis_rtos_v1)
target_sources(app PRIVATE src/main.c)
10 changes: 10 additions & 0 deletions samples/portability/cmsis_rtos_v2/philosophers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,15 @@ cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(philosophers)

if(DEFINED DEBUG_PRINTF)
zephyr_compile_definitions(DEBUG_PRINTF)
endif()
if(DEFINED SAME_PRIO)
zephyr_compile_definitions(SAME_PRIO)
endif()
if(DEFINED FORKS)
zephyr_compile_definitions(FORKS=${FORKS})
endif()

target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/cmsis_rtos_v2)
target_sources(app PRIVATE src/main.c)

0 comments on commit d2a52b8

Please sign in to comment.