Fix building with conan, vcpkg #30157
Open
+9
−3
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.
Details:
Conan fix:
When building with Conan, it creates some template expressions in include directories for dependencies.
They look like this:
The code in question used to be removing only the trailing triangle bracket '>' . That broke this template expression and made cmake treat it as a regular string, failing configuration.
Adding a condition checking that both beginning and the end of the string match before trimming a string fixes this error, but creates another issue:
Turns out some template expressions contain multiple include dirs, see debug output:
They break into list items in such a way that the first part of template expression appears in the first item of the list and the closing part of the expression appears in the last item.
This can be fixed by checking and applying regular expression substitution here in addition to (or maybe in place of) substitution inside the loop.
Vcpkg fix:
Issue happens if
onednn
is installed in vcpkg environment as a package and user attempts to buildopenvino
package withgpu
feature on.The include directy with ambient onednn appear before the one that is used in openvino and this breaks compilation.
There was a fix for this but seems that the issue was reintroduced with some changes.
This new fix tries to put include path for the correct onednn in the beginning of the include paths list to mitigate the issue.
Related to: