This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 974db76cb9 sim/cmake: compatible when nuttx COMPILE_OPTIONS is not set
yet
974db76cb9 is described below
commit 974db76cb9d95b91673f82b3930c193e7008d4ab
Author: buxiasen <[email protected]>
AuthorDate: Thu Oct 24 20:25:51 2024 +0800
sim/cmake: compatible when nuttx COMPILE_OPTIONS is not set yet
Signed-off-by: buxiasen <[email protected]>
---
arch/sim/src/sim/CMakeLists.txt | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/sim/src/sim/CMakeLists.txt b/arch/sim/src/sim/CMakeLists.txt
index 24ae9bc7e9..a6462e1858 100644
--- a/arch/sim/src/sim/CMakeLists.txt
+++ b/arch/sim/src/sim/CMakeLists.txt
@@ -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})