[cmake] Simplify zstd find logic, and support pre-existing zstd target#2390
Open
crueter wants to merge 1 commit intoyhirose:masterfrom
Open
[cmake] Simplify zstd find logic, and support pre-existing zstd target#2390crueter wants to merge 1 commit intoyhirose:masterfrom
crueter wants to merge 1 commit intoyhirose:masterfrom
Conversation
Some deduplication work on the zstd required/if-available logic. Also adds support for pre-existing `zstd::libzstd` which is useful for projects that bundle their own zstd in a way that doesn't get caught by `CONFIG` Signed-off-by: crueter <crueter@eden-emu.dev>
Owner
|
@sum01 @jimmy-park @Tachi107 could you please check the pull request? If it looks good, I'll merge it. Thanks! |
sum01
reviewed
Mar 14, 2026
Comment on lines
+244
to
+252
| if (HTTPLIB_REQUIRE_ZSTD) | ||
| set(HTTPLIB_ZSTD_REQUESTED ON) | ||
| set(HTTPLIB_ZSTD_REQUIRED REQUIRED) | ||
| elseif (HTTPLIB_USE_ZSTD_IF_AVAILABLE) | ||
| set(HTTPLIB_ZSTD_REQUESTED ON) | ||
| set(HTTPLIB_ZSTD_REQUIRED QUIET) | ||
| endif() | ||
|
|
||
| if (HTTPLIB_ZSTD_REQUESTED) |
Contributor
There was a problem hiding this comment.
You should probably just wrap the whole block in an if(TARGET zstd::libztsd) instead of adding more vars.
Contributor
Author
There was a problem hiding this comment.
What do you mean? These vars are only used in the case where the target does not already exist.
Contributor
There was a problem hiding this comment.
Then wrap it with an if(NOT TARGET zstd::libzstd)
Owner
|
@crueter any response? |
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.
Some deduplication work on the zstd required/if-available logic. Also
adds support for pre-existing
zstd::libzstdwhich is useful forprojects that bundle their own zstd in a way that doesn't get caught by
CONFIGSigned-off-by: crueter crueter@eden-emu.dev