Conversation
myd7349
force-pushed
the
fix-cmake-deps
branch
from
September 21, 2026 15:11
9711972 to
892320f
Compare
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 25, 2026
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 25, 2026
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 25, 2026
Static builds of lsl did not forward its transitive dependencies (Threads, Windows iphlpapi/winmm/mswsock/ws2_32, Linux rt/dl, system pugixml) because they were linked PRIVATE via the lslobj object library. Consumers linking LSL::lsl therefore had to manually add these transitive dependencies themselves.
myd7349
force-pushed
the
fix-cmake-deps
branch
from
September 26, 2026 01:37
679c6dd to
681df5c
Compare
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 26, 2026
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 26, 2026
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 26, 2026
myd7349
added a commit
to SharpLSL/liblsl-ci-build
that referenced
this pull request
Sep 26, 2026
myd7349
marked this pull request as ready for review
September 26, 2026 03:29
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Previously, the required system and third-party dependencies were linked only to the
lslobjobject library. Thelsltarget linkedlslobjthrough the build interface:Because
lslobjis not part of the installed export set, its dependencies were not included in the generatedLSLConfig*.cmakefiles. Shared-library builds were unaffected, but consumers of a staticliblslhad to link those dependencies manually.For example, consumers currently need to provide pugixml(LSL_FETCH_PUGIXML=OFF) and platform libraries themselves:
Ideally, consumers should only need to link
LSL::lsl:Solution
For static builds, linking the dependencies directly to lsl, rather than only indirectly through lslobj, is important. CMake records the PRIVATE link dependencies of a static library as $<LINK_ONLY:...> entries in its exported INTERFACE_LINK_LIBRARIES. This allows consumers of the installed LSL::lsl target to receive the dependencies transitively without having to link them manually.
This is also why some properties are configured on both lslobj and lsl, for example:
The same approach is required for the library dependencies.
The PR:
lsllinklibsinDependencies.cmaketo collect the system and third-party libraries required bylslobjandlsl.lslobjandlsl.Installation.cmakeand the package configuration template to add the requiredfind_dependency()calls to the generatedLSLConfig.cmake.pugixml Target Handling
Before pugixml 1.11, its CMake target was named
pugixml; newer versions usepugixml::pugixml. WhenLSL_FETCH_PUGIXMLis enabled, the fetched version is recent enough to usepugixml::pugixmldirectly, so the compatibility alias for the fetched target is unnecessary.When
LSL_FETCH_PUGIXML=OFF, the alias is retained becausetesting/CMakeLists.txtstill links againstpugixml::pugixml. It is created after the actual pugixml target name has been added tolsllinklibs.Why Boost Is Excluded
Boost is a header-only, private compile-time dependency of
lslobj, provided through thelslboostinterface target. No Boost binaries are linked, and no Boost types appear in liblsl’s public headers. Sincelslobjis linked intolslonly through$<BUILD_INTERFACE:lslobj>, Boost is not part of the installed target’s exported interface. Therefore, it does not belong inlsllinklibs, and the installedLSLConfig.cmakedoes not needfind_dependency(Boost).An earlier version of this change added
Boost::boostandBoost::disable_autolinkingtolsllinklibs; those entries and the correspondingfind_dependency(Boost)call have been removed.Testing
Manual testing was performed on Windows 11 and an Ubuntu 24.04 VM. Automated tests were run through GitHub Actions on the
liblsl-issue-304-amendbranch.The branch contains three commits, each corresponding to one of the test runs below:
lslobjwhenLSL_FETCH_PUGIXML=ON.The third test uses the patch from the
fix-cmake-deps-v3branch; that patch is not included in this PR.Each test run used the following GitHub Actions matrix, for 24 configurations:
linkagemaps toLSL_BUILD_STATIC;bundled_boostandfetch_pugixmlmap toLSL_BUNDLED_BOOSTandLSL_FETCH_PUGIXML. Where supported,LSL_TOOLSandLSL_UNITTESTSwere also enabled.The consumer test project uses
find_package(LSL CONFIG REQUIRED)and links its executables only toLSL::lsl.GetFullinfoexercises stream-info APIs that directly depend on pugixml. On Windows, the test also copies the shared LSL library besidelslverwhen testing a shared build.Shared builds passed in all three test runs. The tables below show the results for static builds.
1. Reproducing the issue
All configurations failed because consumers could not resolve required symbols. These were primarily pugixml symbols; on Windows, socket API symbols were also missing.
2. Testing this PR’s patch
Configurations using a system-installed pugixml passed. Configurations with
LSL_FETCH_PUGIXML=ONstill failed.3. Testing the separate pugixml source-integration patch
The third commit tests the separate patch from
fix-cmake-deps-v3. It compiles pugixml’s source directly intolslobjwhenLSL_FETCH_PUGIXML=ON, rather than linking pugixml through a separate target. All tested static configurations passed.This source-integration patch is not included in this PR. If the approach is agreed upon, it can be cherry-picked into this PR or submitted separately.
Open Issues
lsl.pc.inhas not yet been updated to reflect these dependency changes.