Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix static libs INTERFACE_INCLUDE_DIRECTORIES #2505

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update merge_static_libs.cmake to copy INTERFACE_INCLUDE_DIRECTORIES
  • Loading branch information
WangWeiLin-MV authored Nov 15, 2024
commit 281a6d79611700c5f36f759c3012c358e6c432b4
5 changes: 5 additions & 0 deletions cmake/Modules/merge_static_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ function(merge_static_libs target in_target)
set(source_file ${CMAKE_CURRENT_BINARY_DIR}/${target}_depends.c)
add_library(${target} STATIC ${source_file})

get_target_property(include_dirs ${in_target} INTERFACE_INCLUDE_DIRECTORIES)
if(include_dirs)
target_include_directories(${target} PUBLIC ${include_dirs})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @WangWeiLin-MV,

INTERFACE seems more appropriate than PUBLIC because ${include_dirs} comes from the INTERFACE_INCLUDE_DIRECTORIES property of ${in_target}.

Could you see if INTERFACE also works? Thanks!

endif()

avif_collect_deps(${in_target} lib_deps)

foreach(lib ${lib_deps})
Expand Down
Loading