mirror of https://github.com/yshui/picom.git
meson: add support for llvm-style code coverage
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
4dc78789da
commit
f4f22d5e23
|
@ -72,6 +72,7 @@ doxygen/
|
||||||
*.orig
|
*.orig
|
||||||
/tests/log
|
/tests/log
|
||||||
/tests/testcases/__pycache__/
|
/tests/testcases/__pycache__/
|
||||||
|
*.profraw
|
||||||
|
|
||||||
# Subproject files
|
# Subproject files
|
||||||
subprojects/libconfig
|
subprojects/libconfig
|
||||||
|
|
|
@ -36,6 +36,15 @@ if get_option('sanitize')
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if get_option('llvm_coverage')
|
||||||
|
if cc.get_id() != 'clang'
|
||||||
|
error('option \'llvm_coverage\' requires clang')
|
||||||
|
endif
|
||||||
|
coverage_flags = ['-fprofile-instr-generate', '-fcoverage-mapping']
|
||||||
|
add_global_arguments(coverage_flags, language: 'c')
|
||||||
|
add_global_link_arguments(coverage_flags, language: 'c')
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('modularize')
|
if get_option('modularize')
|
||||||
if not cc.has_argument('-fmodules')
|
if not cc.has_argument('-fmodules')
|
||||||
error('option \'modularize\' requires clang')
|
error('option \'modularize\' requires clang')
|
||||||
|
|
|
@ -12,6 +12,9 @@ option('compton', type: 'boolean', value: true, description: 'Install backwards
|
||||||
|
|
||||||
option('with_docs', type: 'boolean', value: false, description: 'Build documentation and man pages')
|
option('with_docs', type: 'boolean', value: false, description: 'Build documentation and man pages')
|
||||||
|
|
||||||
option('modularize', type: 'boolean', value: false, description: 'Build with clang\'s module system')
|
|
||||||
|
|
||||||
option('unittest', type: 'boolean', value: false, description: 'Enable unittests in the code')
|
option('unittest', type: 'boolean', value: false, description: 'Enable unittests in the code')
|
||||||
|
|
||||||
|
# Experimental options
|
||||||
|
|
||||||
|
option('modularize', type: 'boolean', value: false, description: 'Build with clang\'s module system (experimental)')
|
||||||
|
option('llvm_coverage', type: 'boolean', value: false, description: 'Use LLVM source-based code coverage, instead of --coverage. Do not use with b_coverage.')
|
||||||
|
|
Loading…
Reference in New Issue