Skip to content

Commit 058adc7

Browse files
nullccxsynullccxsy
andauthored
fix: use BUILD_INTERFACE to prevent header target dependency propagation (#738)
Wrap roaring-headers and roaring-headers-cpp targets in generator expressions to prevent these internal targets from being propagated to installed packages, improving CMake package compatibility. Co-authored-by: nullccxsy <[email protected]>
1 parent 6ffafc4 commit 058adc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ if(ROARING_DISABLE_NEON)
5959
target_compile_definitions(roaring PUBLIC DISABLENEON=1)
6060
endif(ROARING_DISABLE_NEON)
6161

62-
target_link_libraries(roaring PUBLIC roaring-headers)
63-
target_link_libraries(roaring PUBLIC roaring-headers-cpp)
62+
target_link_libraries(roaring PUBLIC "$<BUILD_INTERFACE:roaring-headers>")
63+
target_link_libraries(roaring PUBLIC "$<BUILD_INTERFACE:roaring-headers-cpp>")
64+
6465
#
6566
#install(TARGETS roaring DESTINATION lib)
6667
#

0 commit comments

Comments
 (0)