diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e96bea..0029adf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ option(DEMO_SIZE_OPT "Enable size optimization flags" OFF) option(DEMO_STRIP_ALL "Strip all unnecessary code for final build" OFF) option(DEMO_BUILD_TESTS "Build tests" OFF) option(DEMO_BUILD_TOOLS "Build tools" OFF) +option(DEMO_ENABLE_COVERAGE "Enable code coverage generation (macOS only)" OFF) option(DEMO_ALL_OPTIONS "Activate all options at once" OFF) if (DEMO_ALL_OPTIONS) @@ -23,6 +24,14 @@ if (DEMO_STRIP_ALL) set(DEMO_SIZE_OPT ON) endif() +if (DEMO_ENABLE_COVERAGE AND APPLE) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") + # Coverage requires debug info + set(CMAKE_BUILD_TYPE Debug) +endif() + #-- - Platform Detection and Core Setup -- - if(APPLE) add_definitions(-DGLFW_EXPOSE_NATIVE_COCOA) |
