@@ -34,7 +34,8 @@ int main() {
34
34
cancompilefp16 = cpp.compiles(fp16code, args :' -march=sapphirerapids' )
35
35
36
36
subdir (' lib' )
37
- libsimdsort = shared_library (' x86simdsortcpp' ,
37
+ if get_option (' lib_type' ) == ' shared'
38
+ libsimdsort = shared_library (' x86simdsortcpp' ,
38
39
' lib/x86simdsort.cpp' ,
39
40
include_directories : [src, utils, lib],
40
41
link_args : [openmpflags],
@@ -43,6 +44,17 @@ libsimdsort = shared_library('x86simdsortcpp',
43
44
install : true ,
44
45
soversion : 1 ,
45
46
)
47
+ else
48
+ libsimdsort = static_library (' x86simdsortcpp' ,
49
+ ' lib/x86simdsort.cpp' ,
50
+ include_directories : [src, utils, lib],
51
+ link_args : [openmpflags],
52
+ link_with : [libtargets],
53
+ gnu_symbol_visibility : ' inlineshidden' ,
54
+ install : true ,
55
+ pic : true ,
56
+ )
57
+ endif
46
58
47
59
pkg_mod = import (' pkgconfig' )
48
60
pkg_mod.generate(libraries : libsimdsort,
@@ -68,10 +80,11 @@ endif
68
80
69
81
if get_option (' build_benchmarks' )
70
82
gbench_dep = dependency (' benchmark' , required : true , static : false )
83
+ thread_dep = dependency (' threads' ) # libbenchmark could need pthread_create
71
84
subdir (' benchmarks' )
72
85
benchexe = executable (' benchexe' ,
73
86
include_directories : [src, lib, utils, bench],
74
- dependencies : [gbench_dep],
87
+ dependencies : [gbench_dep, thread_dep ],
75
88
link_args : [' -lbenchmark_main' , ipplink],
76
89
link_whole : [libbench],
77
90
link_with : libsimdsort,
0 commit comments