mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-30 13:26:58 +00:00
feature add sentry config for mac cmake
This commit is contained in:
@@ -247,15 +247,19 @@ else ()
|
|||||||
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Snapmaker_Orca>"
|
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Snapmaker_Orca>"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
# Copy Sentry crashpad_handler to executable directory for non-bundle builds (e.g., Xcode debugging)
|
# Copy Sentry crashpad_handler to executable directory for non-bundle builds (e.g., Xcode debugging)
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
if (SLIC3R_SENTRY)
|
||||||
COMMAND sh -c "if [ -f '${CMAKE_PREFIX_PATH}/bin/crashpad_handler' ]; then cp -f '${CMAKE_PREFIX_PATH}/bin/crashpad_handler' '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler' && codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler' 2>/dev/null || true; fi"
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
COMMENT "Copying crashpad_handler for Sentry crash reporting"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_PREFIX_PATH}/bin/crashpad_handler" "$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler"
|
||||||
VERBATIM)
|
COMMAND sh -c "codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler' 2>/dev/null || true"
|
||||||
# Copy libsentry.dylib to executable directory for non-bundle builds
|
COMMENT "Copying crashpad_handler for Sentry crash reporting"
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
VERBATIM)
|
||||||
COMMAND sh -c "if [ -f '${CMAKE_PREFIX_PATH}/lib/libsentry.dylib' ]; then cp -f '${CMAKE_PREFIX_PATH}/lib/libsentry.dylib' '$<TARGET_FILE_DIR:Snapmaker_Orca>/libsentry.dylib' && codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/libsentry.dylib' 2>/dev/null || true; fi"
|
# Copy libsentry.dylib to executable directory for non-bundle builds
|
||||||
COMMENT "Copying libsentry.dylib for Sentry crash reporting"
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
VERBATIM)
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_PREFIX_PATH}/lib/libsentry.dylib" "$<TARGET_FILE_DIR:Snapmaker_Orca>/libsentry.dylib"
|
||||||
|
COMMAND sh -c "codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/libsentry.dylib' 2>/dev/null || true"
|
||||||
|
COMMENT "Copying libsentry.dylib for Sentry crash reporting"
|
||||||
|
VERBATIM)
|
||||||
|
endif()
|
||||||
else ()
|
else ()
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Snapmaker_Orca>"
|
WORKING_DIRECTORY "$<TARGET_FILE_DIR:Snapmaker_Orca>"
|
||||||
@@ -289,20 +293,25 @@ else ()
|
|||||||
COMMENT "Symlinking the resources directory into the build tree"
|
COMMENT "Symlinking the resources directory into the build tree"
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
# Copy Sentry crashpad_handler to MacOS directory (same directory as executable)
|
# Copy Sentry crashpad_handler to MacOS directory (same directory as executable)
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
if (SLIC3R_SENTRY)
|
||||||
COMMAND sh -c "if [ -f '${CMAKE_PREFIX_PATH}/bin/crashpad_handler' ]; then cp -f '${CMAKE_PREFIX_PATH}/bin/crashpad_handler' '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler' && codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler'; fi"
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
COMMENT "Copying and signing crashpad_handler for Sentry crash reporting"
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_PREFIX_PATH}/bin/crashpad_handler" "$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler"
|
||||||
VERBATIM)
|
COMMAND sh -c "codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/crashpad_handler' 2>/dev/null || true"
|
||||||
# Copy libsentry.dylib to Frameworks directory
|
COMMENT "Copying and signing crashpad_handler for Sentry crash reporting"
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
VERBATIM)
|
||||||
COMMAND sh -c "if [ -f '${CMAKE_PREFIX_PATH}/lib/libsentry.dylib' ]; then mkdir -p '$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks' && cp -f '${CMAKE_PREFIX_PATH}/lib/libsentry.dylib' '$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks/libsentry.dylib' && codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks/libsentry.dylib'; fi"
|
# Copy libsentry.dylib to Frameworks directory
|
||||||
COMMENT "Copying and signing libsentry.dylib for Sentry crash reporting"
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
VERBATIM)
|
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks"
|
||||||
# Update the rpath for libsentry.dylib
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_PREFIX_PATH}/lib/libsentry.dylib" "$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks/libsentry.dylib"
|
||||||
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
COMMAND sh -c "codesign --force --sign - '$<TARGET_FILE_DIR:Snapmaker_Orca>/../Frameworks/libsentry.dylib' 2>/dev/null || true"
|
||||||
COMMAND install_name_tool -change "@rpath/libsentry.dylib" "@executable_path/../Frameworks/libsentry.dylib" "$<TARGET_FILE:Snapmaker_Orca>" || true
|
COMMENT "Copying and signing libsentry.dylib for Sentry crash reporting"
|
||||||
COMMENT "Updating rpath for libsentry.dylib"
|
VERBATIM)
|
||||||
VERBATIM)
|
# Update the rpath for libsentry.dylib
|
||||||
|
add_custom_command(TARGET Snapmaker_Orca POST_BUILD
|
||||||
|
COMMAND install_name_tool -change "@rpath/libsentry.dylib" "@executable_path/../Frameworks/libsentry.dylib" "$<TARGET_FILE:Snapmaker_Orca>" || true
|
||||||
|
COMMENT "Updating rpath for libsentry.dylib"
|
||||||
|
VERBATIM)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,9 @@
|
|||||||
using namespace nlohmann;
|
using namespace nlohmann;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SLIC3R_SENTRY
|
|
||||||
#include "sentry_wrapper/SentryWrapper.hpp"
|
#include "sentry_wrapper/SentryWrapper.hpp"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
|
|||||||
Reference in New Issue
Block a user