-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[shaderc, spirv-tools] Fix cmake config, add usage, minor fixes #31912
Conversation
The port never installed this lib's headers.
+ set(sgcf_find_extra "") | ||
+ if(NOT "${TARGET}" STREQUAL "SPIRV-Tools-opt") | ||
+ set(sgcf_find_extra "find_dependency(SPIRV-Tools-opt)\n") | ||
+ endif() | ||
file(WRITE ${CMAKE_BINARY_DIR}/${TARGET}Config.cmake | ||
"include(CMakeFindDependencyMacro)\n" | ||
+ ${sgcf_find_extra} |
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.
Fixes #31907 (comment).
-DSPIRV_SKIP_TESTS=ON | ||
-DSPIRV_SKIP_EXECUTABLES=${SKIP_EXECUTABLES} |
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.
This was overridden 3 lines later.
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
# lesspipe.sh is the only file there | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
endif() |
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.
This didn't only remove spirv-lesspipe.sh
, but also the SPIRV-Tools-shared.dll
installed in static builds, while leaving the import lib SPIRV-Tools-shared.lib
untouched.
+ if(NOT BUILD_SHARED_LIBS) | ||
+ set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES EXCLUDE_FROM_ALL 1) | ||
+ list(REMOVE_ITEM SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-shared) | ||
+ endif() |
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.
This is the change to control the presence of SPIRV-Tools-shared
DLL and import lib.
# The static libary is always available. | ||
# It offers full public symbol visibility. | ||
target_link_libraries(main PRIVATE SPIRV-Tools-static) | ||
# In triplets with dynamic library linkage, there is also a shared libary. | ||
target_link_libraries(main PRIVATE SPIRV-Tools-shared) |
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.
The tool libs need always a main lib with all symbols, but for distros, they recommend the shared lib with reduced symbol visibility.
I don't think there is better solution here without patching against upstream's will.
Cf. KhronosGroup/SPIRV-Tools#3909
shadercThe usage test passed (header files found):
spirv-toolsAll features are tested successfully in the following triplet:
The usage test passed (header files found):
🔴 post-build error:
|
Fixed, thanks. |
Fixes #31510.
Fixes #28144.
No version update in this PR.
./vcpkg x-add-version --all
and committing the result.