Conversation
|
@microsoft-github-policy-service agree |
|
Please adjust the |
ports/vtk/findpegtl.patch
Outdated
| + get_target_property(TARGET_IMPORTED_GLOBAL taocpp::pegtl IMPORTED_GLOBAL) | ||
| + if(NOT TARGET_IMPORTED_GLOBAL) | ||
| + set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| + endif() |
There was a problem hiding this comment.
this seems to be the only change
There was a problem hiding this comment.
Yes, the other changes were caused by the automatic conversion of line endings.
Should be fixed now. |
| + get_target_property(TARGET_IMPORTED_GLOBAL taocpp::pegtl IMPORTED_GLOBAL) | ||
| + if(NOT TARGET_IMPORTED_GLOBAL) | ||
| + set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE) | ||
| + endif() |
There was a problem hiding this comment.
I'm confused: Isn't this identical to just deleting the line set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE) ?
If taocpp::pegtl is IMPORTED_GLOBAL, then TARGET_IMPORTED_GLOBAL will be true, and we run set_target_properties(taocpp::pegtl PROPERTIES IMPORTED_GLOBAL TRUE) ... but it already was true.
If taocpp::pegtl is not IMPORTED_GLOBAL, then TARGET_IMPORTED_GLOBAL will be false, and we don't do anything.
I think we need to understand why this IMPORTED_GLOBAL was added in the first place?
There was a problem hiding this comment.
OK, @ras0219-msft pointed out that I missed a NOT.
Can you explain why this fix works?
There was a problem hiding this comment.
If the code is run the first time the imported global is not true and as such gets set. Each subsequent run will thus not set the property which generates the error. Due to the property being set the second run will also not create the target and thus it cannot be modified, so the test is need to see if the target was created in this run. It is a bit annoying setting targets to global but some people just mess up their target scoping.
|
@martinfalk seems like this PR is ready to merge, hopefully it can go in soon as there is another large PR waiting on this one: #37119 🤞 |
|
Thanks for the fix and sorry I read it backwards before |
|
No worries, and happy to contribute :) |
Fixes #35223
./vcpkg x-add-version --alland committing the result.