From 6d7927927c4e5d57936f0291b21a1f1122bc57fd Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 7 Mar 2026 09:18:38 +1000 Subject: [PATCH] Final changes for clang (#570) - Allow overriding the toolchains so I can avoid changes in my working tree - Squash warnings that the deps use, can't just add them as PRIVATE compile flags because it's in the headers :( - Squash those d3d9 warnings with a suppression instead of trying to rewrite 400 lines of code --- src/spice2x/CMakeLists.txt | 6 ++++++ src/spice2x/build_all.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/spice2x/CMakeLists.txt b/src/spice2x/CMakeLists.txt index e540d2e..1bc5895 100644 --- a/src/spice2x/CMakeLists.txt +++ b/src/spice2x/CMakeLists.txt @@ -109,6 +109,12 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # RapidJSON does this add_compile_definitions(_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING) + add_compile_options("-Wno-nontrivial-memcall") # imgui, rapidjson + add_compile_options("-Wno-deprecated-builtins") # robin_hood + add_compile_options("-Wno-deprecated-declarations") # rapidjson + add_compile_options("-Wno-inconsistent-missing-override") # headsocket + add_compile_options("-Wno-microsoft-exception-spec") # gcc/clang have different noexcept specifiers on d3d9 COM interfaces + # warnings set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunknown-warning-option") diff --git a/src/spice2x/build_all.sh b/src/spice2x/build_all.sh index 52da9ae..da2909a 100755 --- a/src/spice2x/build_all.sh +++ b/src/spice2x/build_all.sh @@ -41,8 +41,8 @@ done # settings GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none") GIT_HEAD=$(git rev-parse HEAD || echo "none") -TOOLCHAIN_32="/usr/share/mingw/toolchain-i686-w64-mingw32.cmake" -TOOLCHAIN_64="/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake" +TOOLCHAIN_32="${TOOLCHAIN_32:-"/usr/share/mingw/toolchain-i686-w64-mingw32.cmake"}" +TOOLCHAIN_64="${TOOLCHAIN_64:-"/usr/share/mingw/toolchain-x86_64-w64-mingw32.cmake"}" BUILDDIR_32_RELEASE="./cmake-build-release-32" BUILDDIR_32_DEBUG="./cmake-build-debug-32" BUILDDIR_64_RELEASE="./cmake-build-release-64"