You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2024/04/18 17:58:06 UTC
(nuttx) 03/04: cmake-bugfix:add santity check for target depends and change inter_library header inheritance level
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4b11d37cf7eee4b198ca729054e649d6114ea5de
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Thu Apr 18 09:52:40 2024 +0800
cmake-bugfix:add santity check for target depends and change
inter_library header inheritance level
Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
cmake/nuttx_add_application.cmake | 9 ++++++---
cmake/nuttx_add_library.cmake | 4 ++--
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/cmake/nuttx_add_application.cmake b/cmake/nuttx_add_application.cmake
index 3c4d96d75b..fc12f28518 100644
--- a/cmake/nuttx_add_application.cmake
+++ b/cmake/nuttx_add_application.cmake
@@ -207,10 +207,13 @@ function(nuttx_add_application)
# interface include and libraries
foreach(dep ${DEPENDS})
nuttx_add_dependencies(TARGET ${TARGET} DEPENDS ${dep})
- get_target_property(dep_type ${dep} TYPE)
- if(${dep_type} STREQUAL "STATIC_LIBRARY")
- target_link_libraries(${TARGET} PRIVATE ${dep})
+ if(TARGET ${dep})
+ get_target_property(dep_type ${dep} TYPE)
+ if(${dep_type} STREQUAL "STATIC_LIBRARY")
+ target_link_libraries(${TARGET} PRIVATE ${dep})
+ endif()
endif()
+
endforeach()
endif()
endfunction()
diff --git a/cmake/nuttx_add_library.cmake b/cmake/nuttx_add_library.cmake
index 9a23388aac..8114ba3ca8 100644
--- a/cmake/nuttx_add_library.cmake
+++ b/cmake/nuttx_add_library.cmake
@@ -36,8 +36,8 @@ function(nuttx_add_library_internal target)
# add main include directories
target_include_directories(
${target} SYSTEM
- PUBLIC ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include
- ${CMAKE_BINARY_DIR}/include_arch)
+ PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include
+ ${CMAKE_BINARY_DIR}/include_arch)
# Set global compile options & definitions We use the "nuttx" target to hold
# these properties so that libraries added after this property is set can read