build: properly propagate included directories from dependencies

This commit is contained in:
Gabriel Ferreira
2023-03-30 19:16:47 -03:00
parent 1e49101c39
commit d9499afc72

View File

@@ -193,6 +193,20 @@ function(build_lib)
${lib${BLIB_LIBNAME}} ${exported_libraries} ${private_libraries}
)
if(NOT ${XCODE})
# Since linking libraries to object libraries in not allowed in older CMake
# releases, we need to import each of their include directories. Otherwise,
# include directories won't be properly propagated
set(temp)
foreach(target ${ns_libraries_to_link})
list(APPEND temp
"$<TARGET_PROPERTY:${target},INTERFACE_INCLUDE_DIRECTORIES>"
)
endforeach()
target_include_directories(${lib${BLIB_LIBNAME}}-obj PRIVATE ${temp})
unset(temp)
endif()
# set output name of library
set_target_properties(
${lib${BLIB_LIBNAME}}