-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[vcpkg_fixup_cmake_targets] Add NO_PREFIX_CORRECTION #12215
Merged
strega-nil
merged 6 commits into
microsoft:master
from
Neumann-A:add_option_disable_prefix_correction
Nov 25, 2020
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f9df473
[vcpkg/scripts/fixup_cmake] add option NO_PREFIX_CORRECTION to not ap…
Neumann-A 7512554
add a bit of explanation why the prefix correction might be incorrect.
Neumann-A acdf9c2
apply the if only around the import prefix changes
Neumann-A cac4ea5
Update scripts/cmake/vcpkg_fixup_cmake_targets.cmake
Neumann-A 36bdd02
Merge remote-tracking branch 'upstream/master' into add_option_disabl…
Neumann-A ce4c9d7
Merge remote-tracking branch 'origin/master' into HEAD
BillyONeal 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 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
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.
It seems like it would be best to fix this to handle the targets case instead of adding a switch to disable and then needing to manually write the same fixup code in every port that uses said switch. Do you have an idea of how difficult that would be?
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.
Calculate relative path from
CURRENT_PACKAGES_DIR/<targetfilelocation>
toCURRENT_PACKAGES_DIR
and count the backticks/..
do the same forCURRENT_PACKAGES_DIR/<newtargetfilelocation>
toCURRENT_PACKAGES_DIR
and also count the/..
.The first count gives the number of
get_filename_component
to replace while the later defines the number ofget_filename_component
required. If the count is equal no replacement is necessary. It is not too difficult but probably requires a ton of try and error to just get it to work correctly.I just added NO_PREFIX_CORRECTION as a quick fix since I need it for one of my personal ports. You can always deprecate the parameter later if you have the above mentioned fix. (And probably not a lot of ports require it.)