From cf1a5f08b65714a1a138f64fa7395faea1653f7a Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Mon, 15 Apr 2024 12:13:44 +0200 Subject: [PATCH 1/3] fix: support building with clang-cl --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63cbd229e..4d9fd1807 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,6 +123,15 @@ if(MSVC) $<$:/wd4577> # 'noexcept' used with no exception handling mode specified. $<$:/wd4996> # 'X' was declared deprecated. ) + + if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # clang-cl + target_compile_options(crashpad_interface INTERFACE + $<$:-Wno-missing-field-initializers> # missing field initializer + $<$:-Wno-sign-compare> # comparison of integers of different signs + $<$:-Wno-microsoft-cast> # implicit conversion between pointer-to-function and pointer-to-object + ) + endif() + elseif(MINGW) # redirect to wmain # FIXME: cmake 3.13 added target_link_options From e2535a014e1784cb4256f6c213c6171882bb0adb Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Wed, 9 Oct 2024 10:47:32 +0200 Subject: [PATCH 2/3] fix: add clang-cl flags for MsBuild --- CMakeLists.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d9fd1807..833a1f1cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -122,16 +122,13 @@ if(MSVC) $<$:/wd4351> # New behavior: elements of array will be default initialized. $<$:/wd4577> # 'noexcept' used with no exception handling mode specified. $<$:/wd4996> # 'X' was declared deprecated. + $<$,$>:-Wno-missing-field-initializers> # missing field initializer + $<$,$>:-Wno-sign-compare> # comparison of integers of different signs + $<$,$>:-Wno-microsoft-cast> # implicit conversion between pointer-to-function and pointer-to-object + $<$,$>:-Wno-unused-parameter> # same as /wd4100 + $<$,$>:-Wno-deprecated-declarations> # same as /wd4996 ) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # clang-cl - target_compile_options(crashpad_interface INTERFACE - $<$:-Wno-missing-field-initializers> # missing field initializer - $<$:-Wno-sign-compare> # comparison of integers of different signs - $<$:-Wno-microsoft-cast> # implicit conversion between pointer-to-function and pointer-to-object - ) - endif() - elseif(MINGW) # redirect to wmain # FIXME: cmake 3.13 added target_link_options From 23e0557accc3fc89992ad451c799c47d06defa92 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Wed, 9 Oct 2024 10:49:19 +0200 Subject: [PATCH 3/3] chore: remove empty line --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 833a1f1cf..eb2bb8e8a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -128,7 +128,6 @@ if(MSVC) $<$,$>:-Wno-unused-parameter> # same as /wd4100 $<$,$>:-Wno-deprecated-declarations> # same as /wd4996 ) - elseif(MINGW) # redirect to wmain # FIXME: cmake 3.13 added target_link_options