-
Notifications
You must be signed in to change notification settings - Fork 35
Enable gcov #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable gcov #511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,12 @@ function(add_umf_target_compile_options name) | |
${name} PRIVATE -Werror -fno-omit-frame-pointer | ||
-fstack-protector-strong) | ||
endif() | ||
if(USE_GCOV) | ||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
message(FATAL_ERROR "To use gcov, the build type must be Debug") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it truly a fatal error? I guess we get a different results for Release, but it should work, right...? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From the Clang documentation:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Soo.. it might work in the build type "RelWithDebInfo"...? |
||
endif() | ||
target_compile_options(${name} PRIVATE --coverage) | ||
endif() | ||
elseif(MSVC) | ||
target_compile_options( | ||
${name} | ||
|
@@ -121,6 +127,13 @@ function(add_umf_target_link_options name) | |
if(NOT MSVC) | ||
if(NOT APPLE) | ||
target_link_options(${name} PRIVATE "LINKER:-z,relro,-z,now") | ||
if(USE_GCOV) | ||
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
message( | ||
FATAL_ERROR "To use gcov, the build type must be Debug") | ||
endif() | ||
target_link_options(${name} PRIVATE --coverage) | ||
endif() | ||
endif() | ||
elseif(MSVC) | ||
target_link_options( | ||
|
Uh oh!
There was an error while loading. Please reload this page.