1
1
project (' x86-simd-sort' , ' cpp' ,
2
- version : ' 2 .0.0' ,
2
+ version : ' 4 .0.0' ,
3
3
license : ' BSD 3-clause' ,
4
4
default_options : [' cpp_std=c++17' ])
5
5
cpp = meson .get_compiler(' cpp' )
@@ -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() {
@@ -27,19 +25,32 @@ libsimdsort = shared_library('x86simdsort',
27
25
include_directories : [utils, lib],
28
26
link_with : [libtargets],
29
27
cpp_args : [flags_hide_symbols],
28
+ install : true ,
30
29
)
31
30
32
- if gtest_dep.found()
31
+ pkg_mod = import (' pkgconfig' )
32
+ pkg_mod.generate(libraries : libsimdsort,
33
+ version : ' 4.0' ,
34
+ name : ' libx86simdsort' ,
35
+ filebase : ' x86simdsort' ,
36
+ description : ' High performance SIMD based sorting routines.' )
37
+
38
+ # Build test suite if option build_tests set to true
39
+ if get_option (' build_tests' )
40
+ gtest_dep = dependency (' gtest_main' , required : true , static : false )
33
41
subdir (' tests' )
34
42
testexe = executable (' testexe' ,
35
43
include_directories : [lib, utils],
36
44
dependencies : gtest_dep,
37
45
link_whole : [libtests],
38
46
link_with : libsimdsort,
39
47
)
48
+ test (' x86 simd sort tests' , testexe)
40
49
endif
41
50
42
- if gbench_dep.found()
51
+ # Build benchmarking suite if option build_benchmarks is set to true
52
+ if get_option (' build_benchmarks' )
53
+ gbench_dep = dependency (' benchmark' , required : true , static : false )
43
54
subdir (' benchmarks' )
44
55
benchexe = executable (' benchexe' ,
45
56
include_directories : [src, lib, utils, bench],
52
63
53
64
summary ({
54
65
' Can compile AVX-512 FP16 ISA' : cancompilefp16,
55
- ' Built test content' : gtest_dep.found( ),
56
- ' Built benchmarks' : gbench_dep.found( ),
66
+ ' Build test content' : get_option ( ' build_tests ' ),
67
+ ' Build benchmarks' : get_option ( ' build_benchmarks ' ),
57
68
},
58
69
section : ' Configuration' ,
59
70
bool_yn : true
0 commit comments