summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorSean Kim <seanctkim@gmail.com>2021-10-28 15:00:19 -0700
committerSean Kim <seanctkim@gmail.com>2021-10-28 15:23:23 -0700
commit753836c373340286d39f510edb0fd21773ccd6e6 (patch)
tree2209ea0ff051e7484b8bb9817fc8cc8243f7aa78 /platform
parent9fb9b99cab51173c569f147664c334690f9d5d72 (diff)
Adds support for 'use_coverage' flag in OSX.
Based on #36572 which added support for Linux
Diffstat (limited to 'platform')
-rw-r--r--platform/osx/detect.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 36fff4e12a..6c07c2416e 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -31,6 +31,7 @@ def get_opts():
BoolVariable("use_ubsan", "Use LLVM/GCC compiler undefined behavior sanitizer (UBSAN)", False),
BoolVariable("use_asan", "Use LLVM/GCC compiler address sanitizer (ASAN)", False),
BoolVariable("use_tsan", "Use LLVM/GCC compiler thread sanitizer (TSAN)", False),
+ BoolVariable("use_coverage", "Use instrumentation codes in the binary (e.g. for code coverage)", False),
]
@@ -142,6 +143,10 @@ def configure(env):
env.Append(CCFLAGS=["-fsanitize=thread"])
env.Append(LINKFLAGS=["-fsanitize=thread"])
+ if env["use_coverage"]:
+ env.Append(CCFLAGS=["-ftest-coverage", "-fprofile-arcs"])
+ env.Append(LINKFLAGS=["-ftest-coverage", "-fprofile-arcs"])
+
## Dependencies
if env["builtin_libtheora"]: