11libtargets =  []
22
3- # Add compile flags for OpenMP if enabled 
4- openmpflags =  []
5- if  get_option (' use_openmp' 
6-   openmpflags =  [' -DXSS_USE_OPENMP=true' ' -fopenmp' 
7- endif 
8- 
93if  cpp.has_argument(' -march=haswell' 
104  libtargets +=  static_library (' libavx' 
115    files (
126      ' x86simdsort-avx2.cpp' 
137      ),
148    include_directories  : [src],
15-     cpp_args  : [' -march=haswell' , openmpflags ],
9+     cpp_args  : [' -march=haswell' 
1610    gnu_symbol_visibility  : ' inlineshidden' 
11+     dependencies : [omp_dep],
1712    )
1813endif 
1914
@@ -23,8 +18,9 @@ if cpp.has_argument('-march=skylake-avx512')
2318      ' x86simdsort-skx.cpp' 
2419      ),
2520    include_directories  : [src],
26-     cpp_args  : [' -march=skylake-avx512' , openmpflags ],
21+     cpp_args  : [' -march=skylake-avx512' 
2722    gnu_symbol_visibility  : ' inlineshidden' 
23+     dependencies : [omp_dep],
2824    )
2925endif 
3026
@@ -34,8 +30,9 @@ if cpp.has_argument('-march=icelake-client')
3430      ' x86simdsort-icl.cpp' 
3531      ),
3632    include_directories  : [src],
37-     cpp_args  : [' -march=icelake-client' , openmpflags ],
33+     cpp_args  : [' -march=icelake-client' 
3834    gnu_symbol_visibility  : ' inlineshidden' 
35+     dependencies : [omp_dep],
3936    )
4037endif 
4138
@@ -45,8 +42,9 @@ if cancompilefp16
4542      ' x86simdsort-spr.cpp' 
4643      ),
4744    include_directories  : [src],
48-     cpp_args  : [' -march=sapphirerapids' , openmpflags ],
45+     cpp_args  : [' -march=sapphirerapids' 
4946    gnu_symbol_visibility  : ' inlineshidden' 
47+     dependencies : [omp_dep],
5048    )
5149endif 
5250
0 commit comments