1
0
Fork 0

Build changes for new crash-reporting system.

This commit is contained in:
James Turner 2020-04-07 09:38:13 +01:00
parent 00fd5fbaec
commit 2500534b1e
6 changed files with 51 additions and 2 deletions

View file

@ -76,7 +76,7 @@ include(GNUInstallDirs)
# System detection/default settings
include( DetectDistro )
include( DetectBrowser )
include( ExportDebugSymbols )
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")
set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
set(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "add a postfix, usually empty on windows")
@ -306,6 +306,13 @@ find_package(OpenSceneGraph 3.2.0 REQUIRED
osgGA
)
find_package(sentry)
if (TARGET sentry::sentry)
message(STATUS "Sentry.io crash reporting enabled")
set(HAVE_SENTRY 1)
endif()
if (MSVC)
find_package(CrashRpt)
if (CRASHRPT_FOUND)

View file

@ -48,6 +48,9 @@ if (MSVC AND MSVC_3RDPARTY_ROOT)
set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/lib )
set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenRTI/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/SimGear/include)
# ensure 3rdparty/lib/cmake is searched
list(APPEND CMAKE_PREFIX_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR})
if(NOT BOOST_INCLUDEDIR)
# if this variable was not set by the user, set it to 3rdparty root's
# parent dir, which is the normal location for people using our

View file

@ -0,0 +1,22 @@
# placehodler target for other ones to depend upon
add_custom_target(
debug_symbols
)
function(export_debug_symbols target)
if (APPLE)
add_custom_target(${target}.dSYM
COMMENT "Generating dSYM files for ${target}"
COMMAND dsymutil --out=${target}.dSYM $<TARGET_FILE:${target}>
DEPENDS $<TARGET_FILE:${target}>
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${target}.dSYM DESTINATION symbols OPTIONAL)
add_dependencies(debug_symbols ${target}.dSYM)
endif()
endfunction()

View file

@ -7,7 +7,7 @@ function(setup_fgfs_bundle target)
# in our local CMakeModules dir
set_target_properties(${target} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST FlightGearBundleInfo.plist.in
MACOSX_BUNDLE_GUI_IDENTIFIER "org.flightgear.FlightGear"
MACOSX_BUNDLE_GUI_IDENTIFIER "org.flightgear.mac-nightly"
MACOSX_BUNDLE_SHORT_VERSION_STRING ${FLIGHTGEAR_VERSION}
MACOSX_BUNDLE_LONG_VERSION_STRING "FlightGear ${FLIGHTGEAR_VERSION} Nightly"
MACOSX_BUNDLE_BUNDLE_VERSION ${FLIGHTGEAR_VERSION}

View file

@ -70,3 +70,5 @@
#cmakedefine ENABLE_COMPOSITOR
#cmakedefine ENABLE_SWIFT
#cmakedefine HAVE_SENTRY

View file

@ -101,6 +101,7 @@ endif()
# Set up the target links.
setup_fgfs_libraries(fgfs)
export_debug_symbols(fgfs)
if (APPLE)
install(TARGETS fgfs BUNDLE DESTINATION .)
@ -108,6 +109,20 @@ else()
install(TARGETS fgfs RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
if (TARGET sentry::sentry)
target_link_libraries(fgfs sentry::sentry)
endif()
if (TARGET sentry::crashpad)
if (APPLE)
# install inside the bundle
install(FILES $<TARGET_FILE:sentry::crashpad_handler> DESTINATION fgfs.app/Contents/MacOS OPTIONAL)
else()
# install in the bin-dir, next to the application binary
install(FILES $<TARGET_FILE:sentry::crashpad_handler> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
endif()
endif()
if(ENABLE_METAR)
add_executable(metar metar_main.cxx)
target_link_libraries(metar