@@ -68,15 +68,20 @@ pkg_mod.generate(libraries : libsimdsort,
68
68
filebase : ' x86simdsortcpp' ,
69
69
description : ' C++ template library for high performance SIMD based sorting routines.' )
70
70
71
+ # Create a new dependency variable making it easy to use this as a subproject:
72
+ x86simdsortcpp_dep = declare_dependency (
73
+ include_directories : include_directories (' lib' ),
74
+ link_with : libsimdsort,
75
+ )
76
+
71
77
# Build test suite if option build_tests set to true
72
78
if get_option (' build_tests' )
73
79
gtest_dep = dependency (' gtest_main' , required : true , static : false )
74
80
subdir (' tests' )
75
81
testexe = executable (' testexe' ,
76
82
include_directories : [lib, utils],
77
- dependencies : gtest_dep,
83
+ dependencies : [ gtest_dep, x86simdsortcpp_dep] ,
78
84
link_whole : [libtests],
79
- link_with : libsimdsort,
80
85
)
81
86
test (' x86 simd sort tests' , testexe)
82
87
endif
@@ -89,10 +94,9 @@ if get_option('build_benchmarks')
89
94
subdir (' benchmarks' )
90
95
benchexe = executable (' benchexe' ,
91
96
include_directories : [src, lib, utils, bench],
92
- dependencies : [gbench_dep, thread_dep],
97
+ dependencies : [gbench_dep, thread_dep, x86simdsortcpp_dep ],
93
98
link_args : [' -lbenchmark_main' , ipplink],
94
99
link_whole : [libbench],
95
- link_with : libsimdsort,
96
100
)
97
101
endif
98
102
0 commit comments