46 lines
1.4 KiB
CMake
46 lines
1.4 KiB
CMake
qt_add_library(quickshell-crash STATIC
|
|
main.cpp
|
|
interface.cpp
|
|
handler.cpp
|
|
)
|
|
|
|
qs_pch(quickshell-crash SET large)
|
|
|
|
if (ISOLATED_CPPTRACE)
|
|
message(STATUS "Vendoring cpptrace...")
|
|
include(FetchContent)
|
|
|
|
# For use without internet access see: https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_SOURCE_DIR_%3CuppercaseName%3E
|
|
FetchContent_Declare(
|
|
cpptrace
|
|
GIT_REPOSITORY https://github.com/jeremy-rifkin/cpptrace.git
|
|
GIT_TAG v1.0.4
|
|
)
|
|
|
|
set(CPPTRACE_UNWIND_WITH_LIBUNWIND TRUE)
|
|
FetchContent_MakeAvailable(cpptrace)
|
|
else ()
|
|
find_package(cpptrace REQUIRED)
|
|
|
|
# useful for cross after you have already checked cpptrace is built correctly
|
|
if (NOT DO_NOT_CHECK_CPPTRACE_USABILITY)
|
|
include(CheckCXXSourceRuns)
|
|
set(CMAKE_REQUIRED_LIBRARIES cpptrace::cpptrace)
|
|
check_cxx_source_runs("
|
|
#include <cpptrace/basic.hpp>
|
|
int main() {
|
|
return cpptrace::can_signal_safe_unwind() ? 0 : 1;
|
|
}
|
|
" CPPTRACE_CAN_SIGNAL_SAFE_UNWIND)
|
|
unset(CMAKE_REQUIRED_LIBRARIES)
|
|
|
|
if (NOT CPPTRACE_CAN_SIGNAL_SAFE_UNWIND)
|
|
message(FATAL_ERROR "Cpptrace was built without CPPTRACE_UNWIND_WITH_LIBUNWIND set to true. Fix the package or set ISOLATED_CPPTRACE to true when building Quickshell.")
|
|
endif()
|
|
endif ()
|
|
endif ()
|
|
|
|
# quick linked for pch compat
|
|
target_link_libraries(quickshell-crash PRIVATE quickshell-build Qt::Quick Qt::Widgets cpptrace::cpptrace)
|
|
|
|
target_link_libraries(quickshell PRIVATE quickshell-crash)
|