File tree Expand file tree Collapse file tree 3 files changed +8
-5
lines changed
Expand file tree Collapse file tree 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,9 @@ write_basic_package_version_file(
4141)
4242
4343# Define installation targets
44+ # Note: We only export the final 'lsl' library, not intermediate targets like lslobj.
45+ # Consumers should link to LSL::lsl, not internal object libraries.
4446set (LSLTargets lsl)
45- if (LSL_BUILD_STATIC)
46- list (APPEND LSLTargets lslobj lslboost)
47- endif ()
4847
4948# Install the targets and store configuration information.
5049install (TARGETS ${LSLTargets}
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ endif()
2828# Link dependencies. The only dependency is lslobj, which contains the bulk of the library code and linkages.
2929# Note: We link PRIVATE because lslobj exposes extra symbols that are not part of the public API
3030# but are used by the internal tests.
31- target_link_libraries (lsl PRIVATE lslobj)
31+ # Note: We use BUILD_INTERFACE to avoid requiring lslobj in the export set - the object library's
32+ # objects are linked directly into lsl, so consumers don't need lslobj.
33+ target_link_libraries (lsl PRIVATE $<BUILD_INTERFACE:lslobj>)
3234
3335# Set the include directories for the lsl target.
3436# Note: We had to link lslobj as a PRIVATE dependency, therefore we must manually expose the include directories
Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ if(NOT LSL_OPTIMIZATIONS)
8080endif ()
8181
8282# - pugixml (fetched via FetchContent, linked statically and privately)
83- target_link_libraries (lslobj PRIVATE pugixml::pugixml)
83+ # Use BUILD_INTERFACE to avoid requiring pugixml in the export set - the static
84+ # library objects are linked into lsl directly, so consumers don't need pugixml.
85+ target_link_libraries (lslobj PRIVATE $<BUILD_INTERFACE:pugixml::pugixml>)
8486# Hide pugixml symbols from the shared library on Linux
8587if (UNIX AND NOT APPLE )
8688 target_link_options (lslobj PRIVATE "LINKER:--exclude-libs,libpugixml.a" )
You can’t perform that action at this time.
0 commit comments