Skip to content

Commit

Permalink
spirv-headers: fix failed headers check (google#7416)
Browse files Browse the repository at this point in the history
Due to a cmake misconfiguration, we are installing spirv as part
of the release, public headers. It's now corrected.
  • Loading branch information
poweifeng authored and plepers committed Dec 9, 2023
1 parent 290366d commit 35feeb9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 21 deletions.
8 changes: 3 additions & 5 deletions third_party/spirv-headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# The SPIR-V headers from the SPIR-V Registry
# https://www.khronos.org/registry/spir-v/
#
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.19)
project(SPIRV-Headers VERSION 1.5.5)

# There are two ways to use this project.
Expand All @@ -44,11 +44,9 @@ project(SPIRV-Headers VERSION 1.5.5)
# 2. cmake ..
# 3. cmake --build . --target install

option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples"
${SPIRV_HEADERS_SKIP_EXAMPLES})
option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)

option(SPIRV_HEADERS_SKIP_INSTALL "Skip install"
${SPIRV_HEADERS_SKIP_INSTALL})
option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)

if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
Expand Down
27 changes: 27 additions & 0 deletions third_party/spirv-headers/filament-specific-changes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/third_party/spirv-headers/CMakeLists.txt b/third_party/spirv-headers/CMakeLists.txt
index 9cfba73af..2b8bb5e59 100644
--- a/third_party/spirv-headers/CMakeLists.txt
+++ b/third_party/spirv-headers/CMakeLists.txt
@@ -28,7 +28,7 @@
# The SPIR-V headers from the SPIR-V Registry
# https://www.khronos.org/registry/spir-v/
#
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.19)
project(SPIRV-Headers VERSION 1.5.5)

# There are two ways to use this project.
@@ -44,11 +44,9 @@ project(SPIRV-Headers VERSION 1.5.5)
# 2. cmake ..
# 3. cmake --build . --target install

-option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples"
- ${SPIRV_HEADERS_SKIP_EXAMPLES})
+option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)

-option(SPIRV_HEADERS_SKIP_INSTALL "Skip install"
- ${SPIRV_HEADERS_SKIP_INSTALL})
+option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)

if(NOT ${SPIRV_HEADERS_SKIP_EXAMPLES})
set(SPIRV_HEADERS_ENABLE_EXAMPLES ON)
14 changes: 0 additions & 14 deletions third_party/spirv-tools/.github/workflows/wasm.yml

This file was deleted.

2 changes: 2 additions & 0 deletions third_party/spirv-tools/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ compile_commands.json
/build*/
/buildtools/
/external/googletest
/external/SPIRV-Headers
/external/spirv-headers
/external/effcee
/external/re2
/external/protobuf
Expand Down
5 changes: 3 additions & 2 deletions third_party/spirv-tools/filament-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rm -rf .git .github
git checkout filament-specific-changes.patch FILAMENT_README.md filament-update.sh
git apply filament-specific-changes.patch

HEADERS_HASH=`grep "spirv_headers_revision\':" DEPS | awk '{ print $2 }' | sed "s/[\'\,\\n]//g"`
HEADERS_HASH=`grep "spirv_headers_revision':" DEPS | awk '{ print $2 }' | sed "s/[\'\,\\n]//g"`

# Next we update SPIRV-Headers to the right hash (dependency as given by SPIRV-Tools)
sync_khronos_repo SPIRV-Headers ${HEADERS_HASH}
Expand All @@ -49,5 +49,6 @@ cd ../spirv-headers
rsync -r /tmp/SPIRV-Headers/ ./ --delete
rm -rf .git .github
# Recover the filament specific files lost in the above rsync
git checkout FILAMENT_README.md
git checkout filament-specific-changes.patch FILAMENT_README.md
git apply filament-specific-changes.patch
popd

0 comments on commit 35feeb9

Please sign in to comment.