Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Harrison <zoddicus@users.noreply.github.com>2019-08-07 18:09:55 +0300
committerGitHub <noreply@github.com>2019-08-07 18:09:55 +0300
commit370375d2353de94e9111ddca9f30fa6f1fa04dee (patch)
treef1da8fb3e8760618bccc6bd61cd12a6a2947cd01 /CMakeLists.txt
parent698b56a8f02495d115cd6c5eefd89b812d55b13d (diff)
Add -fextra-semi to Clang builds (#2787)
This will catch instances on the bots where PRs introduce unneeded semi-colons, which are going to cause downstream users problems. Fixes #2781
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9f24e3863..b95b714a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -235,6 +235,21 @@ endmacro(spvtools_pch)
add_subdirectory(external)
+# Warning about extra semi-colons.
+#
+# This is not supported on all compilers/versions. so enabling only
+# for clang, since that works for all versions that our bots run.
+#
+# This is intentionally done after adding the external subdirectory,
+# so we don't enforce this flag on our dependencies, some of which do
+# not pass it.
+#
+# If the minimum version of CMake supported is updated to 3.0 or
+# later, then check_cxx_compiler_flag could be used instead.
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ add_compile_options("-Wextra-semi")
+endif()
+
add_subdirectory(source)
add_subdirectory(tools)