mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
cmake: add -D__NuttX__ to preprocessor
This change allows for linker script files to be properly processed when `#ifdef __NuttX__` is used. Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
This commit is contained in:
parent
c97a7856e3
commit
738f683b7d
1 changed files with 5 additions and 2 deletions
|
|
@ -74,6 +74,7 @@ endif()
|
|||
if(NOT NUTTX_TOOLCHAIN_PREPROCESS_DEFINED)
|
||||
function(nuttx_generate_preprocess_target)
|
||||
|
||||
set(DEFINES -D__NuttX__)
|
||||
# parse arguments into variables
|
||||
|
||||
nuttx_parse_function_args(
|
||||
|
|
@ -92,8 +93,10 @@ if(NOT NUTTX_TOOLCHAIN_PREPROCESS_DEFINED)
|
|||
|
||||
add_custom_command(
|
||||
OUTPUT ${TARGET_FILE}
|
||||
COMMAND ${PREPROCESS} -I${CMAKE_BINARY_DIR}/include -I${NUTTX_DIR}/include
|
||||
-I${NUTTX_CHIP_ABS_DIR} ${SOURCE_FILE} > ${TARGET_FILE}
|
||||
COMMAND
|
||||
${PREPROCESS} ${DEFINES} -I${CMAKE_BINARY_DIR}/include
|
||||
-I${NUTTX_DIR}/include -I${NUTTX_CHIP_ABS_DIR} ${SOURCE_FILE} >
|
||||
${TARGET_FILE}
|
||||
DEPENDS ${SOURCE_FILE} ${DEPENDS})
|
||||
|
||||
endfunction()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue