|
| 1 | +diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 2 | +index 7979fae..5d98d0f 100644 |
| 3 | +--- a/CMakeLists.txt |
| 4 | ++++ b/CMakeLists.txt |
| 5 | +@@ -4,6 +4,9 @@ project(CrashCatchExamples VERSION 1.4.0 LANGUAGES CXX) |
| 6 | + set(CMAKE_CXX_STANDARD 17) |
| 7 | + set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 8 | + |
| 9 | ++option(CRASHCATCH_BUILD_EXAMPLES "Build example programs" OFF) |
| 10 | ++option(CRASHCATCH_BUILD_TESTS "Build test programs" OFF) |
| 11 | ++ |
| 12 | + # === Detect Platform & Set Platform Libraries === |
| 13 | + if(WIN32) |
| 14 | + message(STATUS "Target platform: Windows") |
| 15 | +@@ -55,6 +58,7 @@ install(FILES |
| 16 | + DESTINATION lib/cmake/CrashCatch |
| 17 | + ) |
| 18 | + |
| 19 | ++if(CRASHCATCH_BUILD_EXAMPLES) |
| 20 | + # === Examples === |
| 21 | + add_executable(Example_ZeroConfig examples/Example_ZeroConfig.cpp) |
| 22 | + target_link_libraries(Example_ZeroConfig PRIVATE CrashCatch) |
| 23 | +@@ -79,11 +83,13 @@ target_link_libraries(Example_StackTrace PRIVATE CrashCatch) |
| 24 | + |
| 25 | + add_executable(Example_UploadCrash examples/Example_UploadCrash.cpp) |
| 26 | + target_link_libraries(Example_UploadCrash PRIVATE CrashCatch) |
| 27 | ++endif() |
| 28 | + |
| 29 | ++if(CRASHCATCH_BUILD_TESTS) |
| 30 | + # === Tests === |
| 31 | + add_executable(test_callback_order tests/test_callback_order.cpp) |
| 32 | + target_link_libraries(test_callback_order PRIVATE CrashCatch) |
| 33 | + |
| 34 | + add_executable(test_stack_context tests/test_stack_context.cpp) |
| 35 | + target_link_libraries(test_stack_context PRIVATE CrashCatch) |
| 36 | +- |
| 37 | ++endif() |
0 commit comments