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)