diff --git a/recipes/shaderc/all/conandata.yml b/recipes/shaderc/all/conandata.yml index 2e55dc24494bc..f866b68a84277 100644 --- a/recipes/shaderc/all/conandata.yml +++ b/recipes/shaderc/all/conandata.yml @@ -1,8 +1,21 @@ sources: + "2023.6": + url: "https://github.com/google/shaderc/archive/refs/tags/v2023.6.tar.gz" + sha256: "e40fd4a87a56f6610e223122179f086d5c4f11a7e0e2aa461f0325c3a0acc6ae" "2021.1": url: "https://github.com/google/shaderc/archive/v2021.1.tar.gz" sha256: "047113bc4628da164a3cb845efc20d442728873f6054a68ab56d04a053f2c32b" patches: + "2023.6": + - patch_file: "patches/2023.6/use-conan-dependencies.patch" + patch_description: "Replace third_party with Conan dependencies" + patch_type: "conan" + - patch_file: "patches/2021.1/adapt-update_build_version.py.patch" + patch_description: "Adapt update_build_version.py for Conan" + patch_type: "conan" + - patch_file: "patches/2021.1/install-shaderc_util.patch" + patch_description: "install() shaderc_util" + patch_type: "conan" "2021.1": - patch_file: "patches/2021.1/use-conan-dependencies.patch" patch_description: "Replace third_party with Conan dependencies" diff --git a/recipes/shaderc/all/conanfile.py b/recipes/shaderc/all/conanfile.py index 6e6f7ab9ec91d..326448f867ad0 100644 --- a/recipes/shaderc/all/conanfile.py +++ b/recipes/shaderc/all/conanfile.py @@ -43,16 +43,19 @@ def layout(self): cmake_layout(self, src_folder="src") @property - def _compatible_spirv_version(self): + def _spirv_version(self): return { - "2021.1": "1.3.224.0" + # TODO: bump me once newer versions are available on CCI + # "2023.6": "1.3.261.1", + "2023.6": "1.3.243.0", + "2021.1": "1.3.224.0", }[str(self.version)] def requirements(self): # transitive_headers=True is not required for any of the dependencies - self.requires(f"glslang/{self._compatible_spirv_version}") - self.requires(f"spirv-tools/{self._compatible_spirv_version}") - self.requires(f"spirv-headers/{self._compatible_spirv_version}") + self.requires(f"glslang/{self._spirv_version}") + self.requires(f"spirv-tools/{self._spirv_version}") + self.requires(f"spirv-headers/{self._spirv_version}") def validate(self): if self.settings.compiler.get_safe("cppstd"): diff --git a/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch new file mode 100644 index 0000000000000..b28517493c7a8 --- /dev/null +++ b/recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -120,7 +120,12 @@ + + # Configure subdirectories. + # We depend on these for later projects, so they should come first. +-add_subdirectory(third_party) ++find_package(glslang REQUIRED CONFIG) ++find_package(SPIRV-Headers REQUIRED CONFIG) ++find_package(SPIRV-Tools REQUIRED CONFIG) ++set(glslang_SOURCE_DIR ${glslang_INCLUDE_DIRS}) ++set(SPIRV-Headers_SOURCE_DIR ${SPIRV-Headers_INCLUDE_DIR}/..) ++set(spirv-tools_SOURCE_DIR ${SPIRV-Tools_INCLUDE_DIR}/..) + + add_subdirectory(libshaderc_util) + add_subdirectory(libshaderc) diff --git a/recipes/shaderc/config.yml b/recipes/shaderc/config.yml index 16c8c86c434c0..272340ffeadfd 100644 --- a/recipes/shaderc/config.yml +++ b/recipes/shaderc/config.yml @@ -1,3 +1,5 @@ versions: + "2023.6": + folder: all "2021.1": folder: all