Merged
Conversation
The cmake build has an option to conditionally disable network
support. Similar to `./configure --disable-http` one can say
cmake -B _build -D OP_DISABLE_HTTP=YES && cmake --build _build
Unfortunately this worked by disabling `libopusurl` completely,
which made building the examples fail. The url library can
still be used to load local files or `file://` urls even
when `http(s)://` support is disabled.
Instead, always build the `opusurl` library like the autotools
build does, and instead make the `OP_ENABLE_HTTP` pre-processor
define and the `openssl` link library conditional on the cmake
option.
On OpenIndiana (Illumos) the cmake build fails with indirect symbol references to functions declared by `sys/socket.h`. To address this, check for `getsockopt` linkage, and if it fails try again with `-lsocket` which provides the symbols on that operating system. This doesn't seem to be necessary with the autotools build; perhaps libtool is passing something extra to the linker to have it accept the transitive dependencies. Fixes #60 Fixes https://gitlab.xiph.org/xiph/opusfile/-/issues/2337
In addition to testing the build with a legacy cmake-3.16 upstream package, install the runner's default cmake version and test against that for broader coverage. On the current `gcc:9` container image this is cmake 3.18.4. Also test build with `-D OP_DISABLE_HTTP=YES` to confirm the build completes with this option, if not that it does what it's supposed to. This should protect against regression of the earlier fix.
sezero
approved these changes
Aug 8, 2025
Contributor
Author
|
Thanks! |
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.
Fix
cmake -D OP_DISABLE_HTTP=YESand pass-lsocketon illumos.@h3ndrk @sezero Would appreciate your review on this.