diff --git a/cmake/FetchSentryNative.cmake b/cmake/FetchSentryNative.cmake index 0c7ade5e800..a8d07c416fc 100644 --- a/cmake/FetchSentryNative.cmake +++ b/cmake/FetchSentryNative.cmake @@ -63,6 +63,7 @@ FetchContent_Declare( sentrynative ${_sentrynative_fetch_download_options} SOURCE_DIR "${_sentrynative_source_dir}" + PATCH_COMMAND ${CMAKE_COMMAND} "-DSOURCE_DIR=" -P "${CMAKE_SOURCE_DIR}/lib/exceptionhandler/3rdparty/sentry/PatchSentryNative.cmake" ) FetchContent_GetProperties(sentrynative) set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "Sentry build shared libs" FORCE) diff --git a/lib/exceptionhandler/3rdparty/sentry/PatchSentryNative.cmake b/lib/exceptionhandler/3rdparty/sentry/PatchSentryNative.cmake new file mode 100644 index 00000000000..ef104925ac9 --- /dev/null +++ b/lib/exceptionhandler/3rdparty/sentry/PatchSentryNative.cmake @@ -0,0 +1,14 @@ +if(NOT CMAKE_SCRIPT_MODE_FILE) + message(FATAL_ERROR "This script currently only supports being run via `cmake -P` script mode") +endif() +set(_fullPathToThisScript "${CMAKE_SCRIPT_MODE_FILE}") +get_filename_component(_scriptFolder "${_fullPathToThisScript}" DIRECTORY) + +if((NOT DEFINED SOURCE_DIR) OR (SOURCE_DIR STREQUAL "")) + message(FATAL_ERROR "SOURCE_DIR must be specified on command-line") +endif() + +# Remove compat/mingw/werapi.h (no longer needed) +if (EXISTS "${SOURCE_DIR}/external/crashpad/compat/mingw/werapi.h") + file(REMOVE "${SOURCE_DIR}/external/crashpad/compat/mingw/werapi.h") +endif()