-
-
Notifications
You must be signed in to change notification settings - Fork 483
fix(cmake): Correct Zlib-ng static link by separating link and install targets #929
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
Open
Chirimen-Jako
wants to merge
5
commits into
zlib-ng:develop
Choose a base branch
from
Chirimen-Jako:fix/zlib-static-link
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ad85c75
fix(cmake): Use zlibstatic for linking when building minizip-ng stati…
Chirimen-Jako 2389b56
Merge branch 'zlib-ng:develop' into fix/zlib-static-link
Chirimen-Jako 1af63df
Merge branch 'zlib-ng:develop' into fix/zlib-static-link
Chirimen-Jako 96532ab
Add test/print_vcxproj_linkage.py
Chirimen-Jako 8fc7c44
Merge branch 'fix/zlib-static-link' of https://github.com/Chirimen-Ja…
Chirimen-Jako 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,95 @@ | ||
| import sys | ||
| import xml.etree.ElementTree as ET | ||
| from pathlib import Path | ||
|
|
||
| # --------------------------------------------------------- | ||
| # Generic Search Function | ||
| # --------------------------------------------------------- | ||
| def find_element_by_predicate(root, xpath, ns, predicate): | ||
| for element in root.findall(xpath, ns): | ||
| if predicate(element): | ||
| return element | ||
| return None | ||
|
|
||
| # --------------------------------------------------------- | ||
| # Matcher Factories (Closures) | ||
| # --------------------------------------------------------- | ||
| def make_label_matcher(label_val): | ||
| def matcher(element): | ||
| return (element.get('Label') == label_val) | ||
| return matcher | ||
|
|
||
| def make_condition_matcher(label_val, condition_val): | ||
| def matcher(element): | ||
| return (element.get('Label') == label_val and | ||
| element.get('Condition') == condition_val) | ||
| return matcher | ||
|
|
||
| def make_include_matcher(include_val): | ||
| def matcher(element): | ||
| return include_val in element.get('Include') | ||
| return matcher | ||
|
|
||
| def print_globals(root, ns): | ||
| found_globals = find_element_by_predicate(root, | ||
| 'm:PropertyGroup', | ||
| ns, | ||
| make_label_matcher('Globals')) | ||
|
|
||
| print(f"\tProject GUID: {found_globals.find('m:ProjectGuid', ns).text}") | ||
|
|
||
| found_conf = find_element_by_predicate(root, | ||
| 'm:PropertyGroup', | ||
| ns, | ||
| make_condition_matcher("Configuration", "'$(Configuration)|$(Platform)'=='Release|x64'")) | ||
|
|
||
| print(f"\tConfigurationType: {found_conf.find('m:ConfigurationType', ns).text}") | ||
|
|
||
| def print_reference(root, ns): | ||
| found_ref = find_element_by_predicate(root, | ||
| 'm:ItemGroup/m:ProjectReference', | ||
| ns, | ||
| make_include_matcher(r"build\_deps\zlib-build\zlib")) | ||
|
|
||
| print(f"\tReference Name: {found_ref.find('m:Name', ns).text}") | ||
| print(f"\tReference Project: {found_ref.find('m:Project', ns).text}") | ||
|
|
||
| def print_parent(file, ns): | ||
| try: | ||
| print(f"{file}:") | ||
| if not Path(file).exists(): | ||
| print("\t(file not found)") | ||
| else: | ||
| tree = ET.parse(file) | ||
| root = tree.getroot() | ||
| print_globals(root, ns) | ||
| print_reference(root, ns) | ||
| print() | ||
| except Exception as e: | ||
| sys.stderr.write(f"Error: {e}\n") | ||
|
|
||
| def print_child(file, ns): | ||
| try: | ||
| print(f"{file}:") | ||
| if not Path(file).exists(): | ||
| print("\t(file not found)") | ||
| else: | ||
| tree = ET.parse(file) | ||
| root = tree.getroot() | ||
| print_globals(root, ns) | ||
| print() | ||
| except Exception as e: | ||
| sys.stderr.write(f"Error: {e}\n") | ||
|
|
||
| # --------------------------------------------------------- | ||
| # Main Execution | ||
| # --------------------------------------------------------- | ||
| def main(): | ||
| ns = {'m': 'http://schemas.microsoft.com/developer/msbuild/2003'} | ||
|
|
||
| print_parent('../build/minizip.vcxproj', ns) | ||
| print_child('../build/_deps/zlib-build/zlib.vcxproj', ns) | ||
| print_child('../build/_deps/zlib-build/zlibstatic.vcxproj', ns) | ||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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.
Why get the first item from MINIZIP_DEP? I wonder if there a better way to do this without doing this.