From d81d0deefcb1abee0074ebcbd3e98650704c4593 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Tue, 2 Aug 2022 19:43:00 +0200 Subject: [PATCH] Expose enabled-flag for WER --- CMakeLists.txt | 9 +++++++++ handler/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b6e2e6d5ac..ffdc9bb1f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -115,6 +115,15 @@ if(MSVC) $<$:/wd4577> # 'noexcept' used with no exception handling mode specified. $<$:/wd4996> # 'X' was declared deprecated. ) + + # WER support is only available starting from Win10 build 10941 + if(${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} VERSION_LESS 10.0.19041) + message(STATUS "WER support disabled. Needs target platform >= 10.0.19041 (actual: ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION})") + else() + SET(CRASHPAD_WER_ENABLED TRUE) + SET(CRASHPAD_WER_ENABLED TRUE PARENT_SCOPE) + message(STATUS "WER support enabled") + endif() elseif(MINGW) # redirect to wmain # FIXME: cmake 3.13 added target_link_options diff --git a/handler/CMakeLists.txt b/handler/CMakeLists.txt index fde7d26f64..8fe882ac89 100644 --- a/handler/CMakeLists.txt +++ b/handler/CMakeLists.txt @@ -123,7 +123,7 @@ if(NOT IOS) ) endif() -if(WIN32) +if(CRASHPAD_WER_ENABLED) add_library(crashpad_wer SHARED win/wer/crashpad_wer.cc win/wer/crashpad_wer.h