aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2023-01-16 18:38:37 -0500
committerDavid Neto <dneto@google.com>2023-01-16 18:38:37 -0500
commit07078b0d4af6ef4f9dbd70d592302d42165c6dd2 (patch)
tree31f844e7b7e12e933c10beb1e13ee6bf2d3f1644
parent606234a341285a324c2265d7cddbe7452d0f32fe (diff)
parentd0b02222f33e1e5e1f521e4e4e1cbfa7fe2cf540 (diff)
downloadshaderc-07078b0d4af6ef4f9dbd70d592302d42165c6dd2.tar.gz
Merge commit 'd0b02222f33e1e5e1f521e4e4e1cbfa7fe2cf540' into update-shaderc
d0b0222 Finalize Shaderc v2023.1 ea622ef Update DEPS 8a28280 roller: use 'main' for spirv-tools, spirv-headers, re2 b810acf Explicitly construct a `string_piece` when comparing to `char*` 209acaf Update CMake to 3.17.2 (#1289) 9806490 Remove GCC-based code coverage builds b2428cb Start Shaderc v2022.5 development e3846cd Finalize Shaderc v2022.4 bbecf81 Update DEPS 141b6c2 Add 'BUNDLE DESTINATION' for target install dc9d28a tests: update tests' glslangvalidator version (#1275) aa4de73 Start v2202.4-dev development Testing: checkbuild.py on Linux Change-Id: I0cd90bd6272ee25569e3ee48065e54cc868d4d17
-rw-r--r--CHANGES13
-rw-r--r--CMakeLists.txt2
-rw-r--r--DEPS8
-rw-r--r--README.md23
-rw-r--r--cmake/setup_build.cmake74
-rw-r--r--glslc/CMakeLists.txt3
-rw-r--r--glslc/test/assembly.py2
-rw-r--r--glslc/test/expect.py2
-rw-r--r--glslc/test/option_dash_cap_O.py6
-rw-r--r--glslc/test/option_dash_o.py2
-rw-r--r--kokoro/linux/continuous_gcc_coverage.cfg16
-rw-r--r--kokoro/linux/presubmit_gcc_coverage.cfg16
-rw-r--r--libshaderc/CMakeLists.txt1
-rw-r--r--libshaderc/src/common_shaders_for_test.h6
-rw-r--r--libshaderc_util/include/libshaderc_util/string_piece.h2
-rwxr-xr-xutils/roll-deps6
16 files changed, 34 insertions, 148 deletions
diff --git a/CHANGES b/CHANGES
index 0af1257..fc1eb0d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,18 @@
Revision history for Shaderc
+v2023.1 2022-01-13
+ - General/Build
+ - Removed support for GCC-based code coverage builds
+ - Update minimum CMake to 3.17.2
+ - Fix C++20 compatibility: explicitly construct string_piece when
+ comparing to `char*`
+
+v2022.4 2022-11-30
+ - Update to Glslang 11
+ - Update SPIRV-Tools, SPIRV-Headers dependencies
+ - Add Cmake BUNDLE DESTINATION option for target install
+ - The code coverage build is no longer being tested
+
v2022.3 2022-10-12
- #1264: Implement defaults for SPV_EXT_mesh_shader builtins
- Update SPIRV-Tools to v2022.4
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3bf9d16..0232f9b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.17.2)
if (POLICY CMP00091)
# Enable MSVC Runtime Library Property
diff --git a/DEPS b/DEPS
index 61e1b72..440126d 100644
--- a/DEPS
+++ b/DEPS
@@ -5,11 +5,11 @@ vars = {
'khronos_git': 'https://github.com/KhronosGroup',
'effcee_revision' : '35912e1b7778ec2ddcff7e7188177761539e59',
- 'glslang_revision': '89db4e1caa273a057ea46deba709c6e50001b314',
+ 'glslang_revision': '1fb2f1d7896627d62a289439a2c3e750e551a7ab',
'googletest_revision': 'd9bb8412d60b993365abb53f00b6dad9b2c01b62',
- 're2_revision': 'd2836d1b1c34c4e330a85a1006201db474bf2c8a',
- 'spirv_headers_revision': '85a1ed200d50660786c1a88d9166e871123cce39',
- 'spirv_tools_revision': 'eb0a36633d2acf4de82588504f951ad0f2cecacb',
+ 're2_revision': '954656f47fe8fb505d4818da1e128417a79ea500',
+ 'spirv_headers_revision': 'd13b52222c39a7e9a401b44646f0ca3a640fbd47',
+ 'spirv_tools_revision': '0e6fbba7762c071118b3e84258a358ede31fb609',
}
deps = {
diff --git a/README.md b/README.md
index 0e3075b..7836f37 100644
--- a/README.md
+++ b/README.md
@@ -166,15 +166,6 @@ installed regardless of your OS:
- Shaderc is tested with cmake 3.17.2
- [Python 3](http://www.python.org/): for utility scripts and running the test suite.
-On Linux, the following tools should be installed:
-
-- [`gcov`](https://gcc.gnu.org/onlinedocs/gcc/Gcov.html): for testing code
- coverage, provided by the `gcc` package on Ubuntu.
-- [`lcov`](http://ltp.sourceforge.net/coverage/lcov.php): a graphical frontend
- for `gcov`, provided by the `lcov` package on Ubuntu.
-- [`genhtml`](http://linux.die.net/man/1/genhtml): for creating reports in html
- format from `lcov` output, provided by the `lcov` package on Ubuntu.
-
On Linux, if cross compiling to Windows:
- [`mingw`](http://www.mingw.org): A GCC-based cross compiler targeting Windows
so that generated executables use the Microsoft C runtime libraries.
@@ -225,20 +216,6 @@ test.vert
We track bugs using GitHub -- click on the "Issues" button on
[the project's GitHub page](https://github.com/google/shaderc).
-## Test coverage
-
-On Linux, you can obtain test coverage as follows:
-
-```sh
-cd $BUILD_DIR
-cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DENABLE_CODE_COVERAGE=ON $SOURCE_DIR
-ninja
-ninja report-coverage
-```
-
-Then the coverage report can be found under the `$BUILD_DIR/coverage-report`
-directory.
-
## Bindings
Bindings are maintained by third parties, may contain content
diff --git a/cmake/setup_build.cmake b/cmake/setup_build.cmake
index 5dab384..994de9f 100644
--- a/cmake/setup_build.cmake
+++ b/cmake/setup_build.cmake
@@ -52,80 +52,6 @@ else()
find_package(PythonInterp 3 REQUIRED)
endif()
-
-option(ENABLE_CODE_COVERAGE "Enable collecting code coverage." OFF)
-if (ENABLE_CODE_COVERAGE)
- message(STATUS "Shaderc: code coverage report is on.")
- if (NOT UNIX)
- message(FATAL_ERROR "Code coverage on non-UNIX system not supported yet.")
- endif()
- if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
- message(FATAL_ERROR "Code coverage with non-Debug build can be misleading.")
- endif()
- find_program(LCOV_EXE NAMES lcov)
- if (NOT LCOV_EXE)
- message(FATAL_ERROR "lcov was not found")
- endif()
- find_program(GENHTML_EXE NAMES genhtml)
- if (NOT GENHTML_EXE)
- message(FATAL_ERROR "genhtml was not found")
- endif()
-
- set(LCOV_BASE_DIR ${CMAKE_BINARY_DIR})
- set(LCOV_INFO_FILE ${LCOV_BASE_DIR}/lcov.info)
- set(COVERAGE_STAT_HTML_DIR ${LCOV_BASE_DIR}/coverage-report)
-
- add_custom_target(clean-coverage
- # Remove all gcov .gcda files in the directory recursively.
- COMMAND ${LCOV_EXE} --directory . --zerocounters -q
- # Remove all lcov .info files.
- COMMAND ${CMAKE_COMMAND} -E remove ${LCOV_INFO_FILE}
- # Remove all html report files.
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${COVERAGE_STAT_HTML_DIR}
- # TODO(antiagainst): the following two commands are here to remedy the
- # problem of "reached unexpected end of file" experienced by lcov.
- # The symptom is that some .gcno files are wrong after code change and
- # recompiling. We don't know the exact reason yet. Figure it out.
- # Remove all .gcno files in the directory recursively.
- COMMAND ${PYTHON_EXECUTABLE}
- ${shaderc_SOURCE_DIR}/utils/remove-file-by-suffix.py . ".gcno"
- # .gcno files are not tracked by CMake. So no recompiling is triggered
- # even if they are missing. Unfortunately, we just removed all of them
- # in the above.
- COMMAND ${CMAKE_COMMAND} --build . --target clean
- WORKING_DIRECTORY ${LCOV_BASE_DIR}
- COMMENT "Clean coverage files"
- )
-
- add_custom_target(report-coverage
- COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}
- # Run all tests.
- COMMAND ctest --output-on-failure
- # Collect coverage data from gcov .gcda files.
- COMMAND ${LCOV_EXE} --directory . --capture -o ${LCOV_INFO_FILE}
- # Remove coverage info for system header files.
- COMMAND ${LCOV_EXE}
- --remove ${LCOV_INFO_FILE} '/usr/include/*' -o ${LCOV_INFO_FILE}
- # Remove coverage info for external and third_party code.
- COMMAND ${LCOV_EXE}
- --remove ${LCOV_INFO_FILE} '${shaderc_SOURCE_DIR}/ext/*'
- -o ${LCOV_INFO_FILE}
-
- COMMAND ${LCOV_EXE}
- --remove ${LCOV_INFO_FILE} '${shaderc_SOURCE_DIR}/third_party/*'
- -o ${LCOV_INFO_FILE}
- # Remove coverage info for tests.
- COMMAND ${LCOV_EXE}
- --remove ${LCOV_INFO_FILE} '*_test.cc' -o ${LCOV_INFO_FILE}
- # Generate html report file.
- COMMAND ${GENHTML_EXE}
- ${LCOV_INFO_FILE} -t "Coverage Report" -o ${COVERAGE_STAT_HTML_DIR}
- DEPENDS clean-coverage
- WORKING_DIRECTORY ${LCOV_BASE_DIR}
- COMMENT "Collect and analyze coverage data"
- )
-endif()
-
option(DISABLE_RTTI "Disable RTTI in builds")
if(DISABLE_RTTI)
if(UNIX)
diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
index 31664d1..c8fa6d5 100644
--- a/glslc/CMakeLists.txt
+++ b/glslc/CMakeLists.txt
@@ -67,7 +67,8 @@ shaderc_add_asciidoc(glslc_doc_README README)
if(SHADERC_ENABLE_INSTALL)
install(TARGETS glslc_exe
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
endif(SHADERC_ENABLE_INSTALL)
add_subdirectory(test)
diff --git a/glslc/test/assembly.py b/glslc/test/assembly.py
index 30fdba4..c7b8511 100644
--- a/glslc/test/assembly.py
+++ b/glslc/test/assembly.py
@@ -21,7 +21,7 @@ def assembly_comments():
return """
; SPIR-V
; Version: 1.0
- ; Generator: Google Shaderc over Glslang; 10
+ ; Generator: Google Shaderc over Glslang; 11
; Bound: 6
; Schema: 0"""
diff --git a/glslc/test/expect.py b/glslc/test/expect.py
index 9ac54b2..c58557d 100644
--- a/glslc/test/expect.py
+++ b/glslc/test/expect.py
@@ -27,7 +27,7 @@ import sys
from glslc_test_framework import GlslCTest
from builtins import bytes
-GLSLANG_GENERATOR_VERSION=10
+GLSLANG_GENERATOR_VERSION=11
SHADERC_GENERATOR_NUMBER=13
SHADERC_GENERATOR_WORD=(SHADERC_GENERATOR_NUMBER << 16) + GLSLANG_GENERATOR_VERSION
ASSEMBLER_GENERATOR_WORD=(7<<16)
diff --git a/glslc/test/option_dash_cap_O.py b/glslc/test/option_dash_cap_O.py
index 337610a..fa474f9 100644
--- a/glslc/test/option_dash_cap_O.py
+++ b/glslc/test/option_dash_cap_O.py
@@ -23,7 +23,7 @@ EMPTY_SHADER_IN_CWD = Directory('.', [File('shader.vert', MINIMAL_SHADER)])
ASSEMBLY_WITH_DEBUG_SOURCE = [
'; SPIR-V\n',
'; Version: 1.0\n',
- '; Generator: Google Shaderc over Glslang; 10\n',
+ '; Generator: Google Shaderc over Glslang; 11\n',
'; Bound: 7\n',
'; Schema: 0\n',
' OpCapability Shader\n',
@@ -52,7 +52,7 @@ ASSEMBLY_WITH_DEBUG_SOURCE = [
ASSEMBLY_WITH_DEBUG = [
'; SPIR-V\n',
'; Version: 1.0\n',
- '; Generator: Google Shaderc over Glslang; 10\n',
+ '; Generator: Google Shaderc over Glslang; 11\n',
'; Bound: 6\n',
'; Schema: 0\n',
' OpCapability Shader\n',
@@ -73,7 +73,7 @@ ASSEMBLY_WITH_DEBUG = [
ASSEMBLY_WITHOUT_DEBUG = [
'; SPIR-V\n',
'; Version: 1.0\n',
- '; Generator: Google Shaderc over Glslang; 10\n',
+ '; Generator: Google Shaderc over Glslang; 11\n',
'; Bound: 6\n',
'; Schema: 0\n',
' OpCapability Shader\n',
diff --git a/glslc/test/option_dash_o.py b/glslc/test/option_dash_o.py
index cd7f1d1..5b9ef45 100644
--- a/glslc/test/option_dash_o.py
+++ b/glslc/test/option_dash_o.py
@@ -92,7 +92,7 @@ class OutputFileBinaryAvoidsCRLFTranslation(expect.ReturnCodeIsZero,
num_newlines = len(newlines)
if num_newlines % 4 == 0:
return False, "Bad test. Need nontrivial number of newlines"
- if num_newlines != 3:
+ if num_newlines != 2:
return False, ("Update this test. Expected 3 newlines in the "
"binary, but found {}").format(num_newlines)
return self.verify_binary_length_and_header(bytes(status.stdout))
diff --git a/kokoro/linux/continuous_gcc_coverage.cfg b/kokoro/linux/continuous_gcc_coverage.cfg
deleted file mode 100644
index ab2878c..0000000
--- a/kokoro/linux/continuous_gcc_coverage.cfg
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2017 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Continuous build configuration.
-build_file: "shaderc/kokoro/linux/build_gcc_coverage.sh"
diff --git a/kokoro/linux/presubmit_gcc_coverage.cfg b/kokoro/linux/presubmit_gcc_coverage.cfg
deleted file mode 100644
index 54733b0..0000000
--- a/kokoro/linux/presubmit_gcc_coverage.cfg
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2017 Google Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Presubmit build configuration.
-build_file: "shaderc/kokoro/linux/build_gcc_coverage.sh"
diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt
index 3ada419..2cced9e 100644
--- a/libshaderc/CMakeLists.txt
+++ b/libshaderc/CMakeLists.txt
@@ -57,6 +57,7 @@ if(SHADERC_ENABLE_INSTALL)
install(TARGETS shaderc shaderc_shared
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(SHADERC_ENABLE_INSTALL)
diff --git a/libshaderc/src/common_shaders_for_test.h b/libshaderc/src/common_shaders_for_test.h
index e177797..b8c581f 100644
--- a/libshaderc/src/common_shaders_for_test.h
+++ b/libshaderc/src/common_shaders_for_test.h
@@ -233,7 +233,7 @@ const char kVertexOnlyShaderWithInvalidPragma[] =
const char* kMinimalShaderDisassemblySubstrings[] = {
"; SPIR-V\n"
"; Version: 1.0\n"
- "; Generator: Google Shaderc over Glslang; 10\n"
+ "; Generator: Google Shaderc over Glslang; 11\n"
"; Bound:",
" OpCapability Shader\n",
@@ -245,7 +245,7 @@ const char* kMinimalShaderDisassemblySubstrings[] = {
const char* kMinimalShaderDebugInfoDisassemblySubstrings[] = {
"; SPIR-V\n"
"; Version: 1.0\n"
- "; Generator: Google Shaderc over Glslang; 10\n"
+ "; Generator: Google Shaderc over Glslang; 11\n"
"; Bound:",
" OpCapability Shader\n",
@@ -257,7 +257,7 @@ const char* kMinimalShaderDebugInfoDisassemblySubstrings[] = {
const char kMinimalShaderAssembly[] = R"(
; SPIR-V
; Version: 1.0
- ; Generator: Google Shaderc over Glslang; 10
+ ; Generator: Google Shaderc over Glslang; 11
; Bound: 6
; Schema: 0
diff --git a/libshaderc_util/include/libshaderc_util/string_piece.h b/libshaderc_util/include/libshaderc_util/string_piece.h
index 89049d9..8d334df 100644
--- a/libshaderc_util/include/libshaderc_util/string_piece.h
+++ b/libshaderc_util/include/libshaderc_util/string_piece.h
@@ -332,7 +332,7 @@ inline std::ostream& operator<<(std::ostream& os, const string_piece& piece) {
}
inline bool operator==(const char* first, const string_piece second) {
- return second == first;
+ return second == string_piece(first);
}
inline bool operator!=(const char* first, const string_piece second) {
diff --git a/utils/roll-deps b/utils/roll-deps
index 4962fd6..ab014cd 100755
--- a/utils/roll-deps
+++ b/utils/roll-deps
@@ -25,11 +25,11 @@ glslang_trunk="origin/master"
googletest_dir="third_party/googletest/"
googletest_trunk="origin/master"
re2_dir="third_party/re2/"
-re2_trunk="origin/master"
+re2_trunk="origin/main"
spirv_headers_dir="third_party/spirv-headers/"
-spirv_headers_trunk="origin/master"
+spirv_headers_trunk="origin/main"
spirv_tools_dir="third_party/spirv-tools/"
-spirv_tools_trunk="origin/master"
+spirv_tools_trunk="origin/main"
# This script assumes it's parent directory is the repo root.
repo_path=$(dirname "$0")/..