Skip to content
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

[vsg] Fix build error when the Vulkan component glslangValidator is already installed #31843

Merged
merged 2 commits into from
Jun 7, 2023

Conversation

LilyWangLL
Copy link
Contributor

Fixes #31801
When Vulkan component glslangValidator is already installed, vsg will install failed with the following error:

C:\Dev\vcpkg\buildtrees\vsg\src\v1.0.5-2524ec1552.clean\src\vsg\utils\ShaderCompiler.cpp(172): error C2065: 'EShLangTask': undeclared identifier
C:\Dev\vcpkg\buildtrees\vsg\src\v1.0.5-2524ec1552.clean\src\vsg\utils\ShaderCompiler.cpp(176): error C2065: 'EShLangMesh': undeclared identifier
C:\Dev\vcpkg\buildtrees\vsg\src\v1.0.5-2524ec1552.clean\src\vsg\utils\ShaderCompiler.cpp(282): error C2039: 'emitNonSemanticShaderDebugInfo': is not a member of 'glslang::SpvOptions'
C:\VulkanSDK\1.3.204.1\Include\glslang\SPIRV\SpvTools.h(55): note: see declaration of 'glslang::SpvOptions'
C:\Dev\vcpkg\buildtrees\vsg\src\v1.0.5-2524ec1552.clean\src\vsg\utils\ShaderCompiler.cpp(283): error C2039: 'emitNonSemanticShaderDebugSource': is not a member of 'glslang::SpvOptions'
C:\VulkanSDK\1.3.204.1\Include\glslang\SPIRV\SpvTools.h(55): note: see declaration of 'glslang::SpvOptions'

Because vsg is calling the glslang headers provided by Vulkan, it did not use the glslang headers which provided by glslang in vcpkg.

The upstream use internal gslang, the related codes are as below:

if (${VSG_SUPPORTS_ShaderCompiler})

    # include glslang source code directly into the VulkanScenegraph library build.
    include(../glslang/build_vars.cmake)
endif()

# set up library dependencies
set(LIBRARIES PUBLIC
        Vulkan::Vulkan
        Threads::Threads
)
......
target_include_directories(vsg
    PUBLIC
        $<BUILD_INTERFACE:${VSG_SOURCE_DIR}/include>
        $<BUILD_INTERFACE:${VSG_BINARY_DIR}/include>
    PRIVATE
        $<BUILD_INTERFACE:${VSG_SOURCE_DIR}/src/glslang>
        $<BUILD_INTERFACE:${GLSLANG_GENERATED_INCLUDEDIR}>
)

Since we want use glslang provided by vcpkg instead of internal glslang, we need to follow the order of upstream linked libraries, linking glslang first and then linking Vulkan.

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@LilyWangLL LilyWangLL added category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. labels Jun 6, 2023
@LilyWangLL LilyWangLL marked this pull request as ready for review June 7, 2023 01:34
@FrankXie05 FrankXie05 added the info:reviewed Pull Request changes follow basic guidelines label Jun 7, 2023
@dan-shaw dan-shaw merged commit b33cf57 into microsoft:master Jun 7, 2023
@LilyWangLL LilyWangLL deleted the dev/LilyWang/issue31801 branch June 15, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:internal This PR or Issue was filed by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vsg] Build error
3 participants