6161                            )
6262endif 
6363
64- x86simdsortcpp_dep =  declare_dependency (
65-   include_directories : include_directories (' lib' 
66-   link_with : libsimdsort,
67- )
68- 
6964pkg_mod =  import (' pkgconfig' 
7065pkg_mod.generate(libraries  : libsimdsort,
7166                 version  : ' 4.0' 
7267                 name  : ' libx86simdsortcpp' 
7368                 filebase  : ' x86simdsortcpp' 
7469                 description  : ' C++ template library for high performance SIMD based sorting routines.' 
7570
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+ 
7677# Build test suite if option build_tests set to true 
7778if  get_option (' build_tests' 
7879  gtest_dep =  dependency (' gtest_main' required  : true , static : false )
7980  subdir (' tests' 
8081  testexe =  executable (' testexe' 
8182                     include_directories  : [lib, utils],
82-                      dependencies  : gtest_dep,
83+                      dependencies  : [ gtest_dep, x86simdsortcpp_dep] ,
8384                     link_whole  : [libtests],
84-                      link_with  : libsimdsort,
8585                    )
8686  test (' x86 simd sort tests' 
8787endif 
@@ -94,10 +94,9 @@ if get_option('build_benchmarks')
9494  subdir (' benchmarks' 
9595  benchexe =  executable (' benchexe' 
9696                      include_directories  : [src, lib, utils, bench],
97-                       dependencies  : [gbench_dep, thread_dep],
97+                       dependencies  : [gbench_dep, thread_dep, x86simdsortcpp_dep ],
9898                      link_args : [' -lbenchmark_main' 
9999                      link_whole  : [libbench],
100-                       link_with  : libsimdsort,
101100                     )
102101endif 
103102
0 commit comments