summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Kwak <82421531+jkwak-work@users.noreply.github.com>2024-07-18 14:31:27 -0700
committerGitHub <noreply@github.com>2024-07-18 14:31:27 -0700
commitbe66cc88acebe87e175659df1afc2e4586ed8958 (patch)
tree6f3e07cc0017e7d1483c176c1144829db47b375d
parentad379b7c532bef5ac49e6d730027ac8751e618d7 (diff)
Enable warnings-as-error for CI (#4659)
Enable warnings-as-error for CI Closes #4664. Uses glslang commit that fixed a compiler warning Fixes a recent warning from external/CMakelist.txt A new macro, `SLANG_MAYBE_UNUSED` is added for a future need.
-rw-r--r--.github/workflows/ci.yml10
-rw-r--r--.github/workflows/compile-regression-test.yml2
-rw-r--r--.github/workflows/falcor-compiler-perf-test.yml2
-rw-r--r--.github/workflows/falcor-test.yml2
-rw-r--r--.github/workflows/vk-gl-cts-nightly.yml2
-rw-r--r--external/CMakeLists.txt6
m---------external/glslang0
-rw-r--r--include/slang.h6
8 files changed, 21 insertions, 9 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cdf315d8e..a45d7647c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -32,9 +32,11 @@ jobs:
- { os: linux, runs-on: ubuntu-20.04 }
- { os: macos, runs-on: macos-latest }
- { os: windows, runs-on: windows-latest }
- # When to have warnings
- - warnings-as-errors: false
- - { compiler: cl, warnings-as-errors true }
+ # Warnings are treated as errors by default.
+ # But we may want to disable it temporarily.
+ - { os: linux, warnings-as-errors: true }
+ - { os: macos, warnings-as-errors: true }
+ - { os: windows, warnings-as-errors: true }
# Set a test category depending on the config, smoke by default,
# quick or full conditionally otherwise
- test-category: smoke
@@ -47,7 +49,6 @@ jobs:
config: release
compiler: gcc
platform: aarch64
- warnings-as-errors: false
test-category: smoke
full-gpu-tests: false
runs-on: [self-hosted, Linux, ARM64]
@@ -56,7 +57,6 @@ jobs:
config: release
compiler: cl
platform: x86_64
- warnings-as-errors: false
test-category: full
full-gpu-tests: true
runs-on: [Windows, self-hosted]
diff --git a/.github/workflows/compile-regression-test.yml b/.github/workflows/compile-regression-test.yml
index b6b484b9a..bd1011f86 100644
--- a/.github/workflows/compile-regression-test.yml
+++ b/.github/workflows/compile-regression-test.yml
@@ -21,7 +21,7 @@ jobs:
platform: [x86_64]
include:
# Self-hosted falcor tests
- - warnings-as-errors: false
+ - warnings-as-errors: true
test-category: full
full-gpu-tests: false
runs-on: [Windows, self-hosted, regression-test]
diff --git a/.github/workflows/falcor-compiler-perf-test.yml b/.github/workflows/falcor-compiler-perf-test.yml
index 449944181..2fe168ade 100644
--- a/.github/workflows/falcor-compiler-perf-test.yml
+++ b/.github/workflows/falcor-compiler-perf-test.yml
@@ -23,7 +23,7 @@ jobs:
platform: [x86_64]
include:
# Self-hosted falcor tests
- - warnings-as-errors: false
+ - warnings-as-errors: true
test-category: full
full-gpu-tests: false
runs-on: [Windows, self-hosted, perf]
diff --git a/.github/workflows/falcor-test.yml b/.github/workflows/falcor-test.yml
index 9dccb6af2..04c734bd4 100644
--- a/.github/workflows/falcor-test.yml
+++ b/.github/workflows/falcor-test.yml
@@ -21,7 +21,7 @@ jobs:
platform: [x86_64]
include:
# Self-hosted falcor tests
- - warnings-as-errors: false
+ - warnings-as-errors: true
test-category: full
full-gpu-tests: false
runs-on: [Windows, self-hosted, falcor]
diff --git a/.github/workflows/vk-gl-cts-nightly.yml b/.github/workflows/vk-gl-cts-nightly.yml
index 374ea1b43..a835d20fc 100644
--- a/.github/workflows/vk-gl-cts-nightly.yml
+++ b/.github/workflows/vk-gl-cts-nightly.yml
@@ -18,7 +18,7 @@ jobs:
compiler: cl
platform: x86_64
config: release
- warnings-as-errors: false
+ warnings-as-errors: true
test-category: full
full-gpu-tests: false
runs-on: [Windows, self-hosted]
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 72a27285e..3ad07f10a 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -26,6 +26,12 @@ endif()
# LZ4
set(LZ4_BUNDLED_MODE ON)
add_subdirectory(lz4/build/cmake EXCLUDE_FROM_ALL SYSTEM)
+if(MSVC)
+ target_compile_options(
+ lz4_static
+ PRIVATE /wd5045 /wd4820 /wd4711 /wd6385 /wd6262
+ )
+endif()
# Vulkan headers
add_subdirectory(vulkan EXCLUDE_FROM_ALL SYSTEM)
diff --git a/external/glslang b/external/glslang
-Subproject 4c20dc0cbb3b20d2afb9ee8595a39508f106662
+Subproject d86ef8a6e2b10508266ec8d63d64e866479d70d
diff --git a/include/slang.h b/include/slang.h
index 86ca4649b..76743a426 100644
--- a/include/slang.h
+++ b/include/slang.h
@@ -326,6 +326,12 @@ convention for interface methods.
# define SLANG_UNUSED(v) (void)v;
#endif
+#if defined(__llvm__)
+# define SLANG_MAYBE_UNUSED [[maybe_unused]]
+#else
+# define SLANG_MAYBE_UNUSED
+#endif
+
// Used for doing constant literals
#ifndef SLANG_INT64
# define SLANG_INT64(x) (x##ll)