Skip to content

Commit

Permalink
sim/cmake: compatible when nuttx COMPILE_OPTIONS is not set yet
Browse files Browse the repository at this point in the history
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
  • Loading branch information
jasonbu authored and xiaoxiang781216 committed Oct 24, 2024
1 parent 7bf6325 commit 974db76
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions arch/sim/src/sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,12 @@ set(HOSTSRCS ${WINHOSTSRCS})
target_sources(nuttx PRIVATE ${HOSTSRCS})

get_target_property(HOST_COMPILE_OPTIONS nuttx COMPILE_OPTIONS)
foreach(remove_item IN LISTS SIM_NO_HOST_OPTIONS)
list(REMOVE_ITEM HOST_COMPILE_OPTIONS ${remove_item})
endforeach()
set_target_properties(nuttx PROPERTIES COMPILE_OPTIONS
"${HOST_COMPILE_OPTIONS}")
if(HOST_COMPILE_OPTIONS)
foreach(remove_item IN LISTS SIM_NO_HOST_OPTIONS)
list(REMOVE_ITEM HOST_COMPILE_OPTIONS ${remove_item})
endforeach()
set_target_properties(nuttx PROPERTIES COMPILE_OPTIONS
"${HOST_COMPILE_OPTIONS}")
endif()

target_compile_definitions(nuttx PRIVATE ${HOST_DEFINITIONS})

0 comments on commit 974db76

Please sign in to comment.