samples: philosophers: evaluate variables coming from command line
The variables passed by sanitycheck and west were being ignored because cmake knows nothing about them. Fixes #24178 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
e55f1987a0
commit
acc0e9025d
3 changed files with 32 additions and 0 deletions
|
@ -4,4 +4,16 @@ cmake_minimum_required(VERSION 3.13.1)
|
||||||
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(philosophers)
|
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)
|
target_sources(app PRIVATE src/main.c)
|
||||||
|
|
|
@ -4,5 +4,15 @@ cmake_minimum_required(VERSION 3.13.1)
|
||||||
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(philosophers_cmsis_rtos_v1)
|
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_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/cmsis_rtos_v1)
|
||||||
target_sources(app PRIVATE src/main.c)
|
target_sources(app PRIVATE src/main.c)
|
||||||
|
|
|
@ -4,5 +4,15 @@ cmake_minimum_required(VERSION 3.13.1)
|
||||||
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
|
||||||
project(philosophers)
|
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_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/cmsis_rtos_v2)
|
||||||
target_sources(app PRIVATE src/main.c)
|
target_sources(app PRIVATE src/main.c)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue