-
-
Notifications
You must be signed in to change notification settings - Fork 470
cmake: better zlib-ng / zlib handling #886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
find_path(ZLIB-NG_INCLUDE_DIRS NAMES zlib-ng.h) | ||
|
||
if(ZLIB_INCLUDE_DIRS) | ||
set(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_INCLUDE_DIRS}) | ||
|
||
if("${ZLIB-NG_LIBRARY_DIRS}" MATCHES "/include$") | ||
# Strip off the trailing "/include" in the path. | ||
get_filename_component(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_LIBRARY_DIRS} PATH) | ||
endif() | ||
|
||
if(EXISTS "${ZLIB-NG_LIBRARY_DIRS}/lib") | ||
set(ZLIB-NG_LIBRARY_DIRS ${ZLIB-NG_LIBRARY_DIRS}/lib) | ||
endif() | ||
endif() | ||
|
||
find_library(ZLIB-NG_LIBRARY NAMES z-ng libz-ng libz-ng.a) | ||
|
||
set(ZLIB-NG_LIBRARIES ${ZLIB-NG_LIBRARY}) | ||
set(ZLIB-NG_INCLUDE_DIRS ${ZLIB-NG_INCLUDE_DIRS}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(ZLIB-NG DEFAULT_MSG ZLIB-NG_LIBRARY ZLIB-NG_INCLUDE_DIRS) | ||
|
||
if(ZLIB-NG_INCLUDE_DIRS AND ZLIB-NG_LIBRARIES) | ||
set(ZLIB-NG_FOUND ON) | ||
else(ZLIB-NG_INCLUDE_DIRS AND ZLIB-NG_LIBRARIES) | ||
set(ZLIB-NG_FOUND OFF) | ||
endif() | ||
|
||
if(ZLIB-NG_FOUND) | ||
message(STATUS "Found zlib-ng: ${ZLIB-NG_LIBRARIES}, ${ZLIB-NG_INCLUDE_DIRS}") | ||
endif() |
This file was deleted.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use option() here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the README be updated to include the new option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, updating the readme for that is a good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
option is boolean - it could be framed as
MZ_ZLIB_PREFER_ZLIB-NG
or something like that.Not sure if that's any better but i can do that if you provide the name 😅
With MZ_SANITIZER we already do it with a string "option".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done