@@ -8,8 +8,6 @@ lib = include_directories('lib')
8
8
bench = include_directories (' benchmarks' )
9
9
utils = include_directories (' utils' )
10
10
tests = include_directories (' tests' )
11
- gtest_dep = dependency (' gtest_main' , required : false , static : false )
12
- gbench_dep = dependency (' benchmark' , required : false , static : false )
13
11
14
12
fp16code = ''' #include<immintrin.h>
15
13
int main() {
@@ -29,7 +27,9 @@ libsimdsort = shared_library('x86simdsort',
29
27
cpp_args : [flags_hide_symbols],
30
28
)
31
29
32
- if gtest_dep.found()
30
+ # Build test suite if option build_tests set to true
31
+ if get_option (' build_tests' )
32
+ gtest_dep = dependency (' gtest_main' , required : true , static : false )
33
33
subdir (' tests' )
34
34
testexe = executable (' testexe' ,
35
35
include_directories : [lib, utils],
@@ -39,7 +39,9 @@ if gtest_dep.found()
39
39
)
40
40
endif
41
41
42
- if gbench_dep.found()
42
+ # Build benchmarking suite if option build_benchmarks is set to true
43
+ if get_option (' build_benchmarks' )
44
+ gbench_dep = dependency (' benchmark' , required : true , static : false )
43
45
subdir (' benchmarks' )
44
46
benchexe = executable (' benchexe' ,
45
47
include_directories : [src, lib, utils, bench],
52
54
53
55
summary ({
54
56
' Can compile AVX-512 FP16 ISA' : cancompilefp16,
55
- ' Built test content' : gtest_dep.found( ),
56
- ' Built benchmarks' : gbench_dep.found( ),
57
+ ' Build test content' : get_option ( ' build_tests ' ),
58
+ ' Build benchmarks' : get_option ( ' build_benchmarks ' ),
57
59
},
58
60
section : ' Configuration' ,
59
61
bool_yn : true
0 commit comments