Skip to content

Commit

Permalink
shaderc: add v2023.6
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Feb 21, 2024
1 parent 499dc5b commit 7dfd138
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 5 deletions.
13 changes: 13 additions & 0 deletions recipes/shaderc/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
13 changes: 8 additions & 5 deletions recipes/shaderc/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
17 changes: 17 additions & 0 deletions recipes/shaderc/all/patches/2023.6/use-conan-dependencies.patch
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions recipes/shaderc/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"2023.6":
folder: all
"2021.1":
folder: all

0 comments on commit 7dfd138

Please sign in to comment.