11project (' x86-simd-sort' , ' cpp' ,
2- version : ' 2 .0.0' ,
2+ version : ' 4 .0.0' ,
33 license : ' BSD 3-clause' ,
44 default_options : [' cpp_std=c++17' ])
55cpp = meson .get_compiler(' cpp' )
@@ -8,8 +8,6 @@ lib = include_directories('lib')
88bench = include_directories (' benchmarks' )
99utils = include_directories (' utils' )
1010tests = include_directories (' tests' )
11- gtest_dep = dependency (' gtest_main' , required : false , static : false )
12- gbench_dep = dependency (' benchmark' , required : false , static : false )
1311
1412fp16code = ''' #include<immintrin.h>
1513int main() {
@@ -27,19 +25,32 @@ libsimdsort = shared_library('x86simdsort',
2725 include_directories : [utils, lib],
2826 link_with : [libtargets],
2927 cpp_args : [flags_hide_symbols],
28+ install : true ,
3029 )
3130
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 )
3341 subdir (' tests' )
3442 testexe = executable (' testexe' ,
3543 include_directories : [lib, utils],
3644 dependencies : gtest_dep,
3745 link_whole : [libtests],
3846 link_with : libsimdsort,
3947 )
48+ test (' x86 simd sort tests' , testexe)
4049endif
4150
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 )
4354 subdir (' benchmarks' )
4455 benchexe = executable (' benchexe' ,
4556 include_directories : [src, lib, utils, bench],
5263
5364summary ({
5465 ' 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 ' ),
5768 },
5869 section : ' Configuration' ,
5970 bool_yn : true
0 commit comments