Skip to content

Commit

Permalink
cmake-bugfix:add santity check for target depends and change
Browse files Browse the repository at this point in the history
inter_library header inheritance level

Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 authored and acassis committed Apr 18, 2024
1 parent 6960f1b commit 4b11d37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions cmake/nuttx_add_application.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions cmake/nuttx_add_library.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4b11d37

Please sign in to comment.