@@ -3,18 +3,22 @@ project('sleef', version: '3.8')
3
3
cmake = find_program (' cmake' )
4
4
ninja = find_program (' ninja' , ' make' , required : false )
5
5
6
-
7
6
sleef_build_dir = ' sleef_build'
8
7
sleef_install_dir = ' sleef_install'
9
8
9
+ # This can be done manually from user side, but lets handle it here as well
10
+ libdir = ' lib'
11
+ if host_machine .system() == ' linux' and host_machine .cpu_family() == ' x86_64'
12
+ libdir = ' lib64'
13
+ endif
10
14
11
15
sleef_configure = run_command ([
12
16
cmake,
13
17
' -S' , meson .current_source_dir(),
14
18
' -B' , meson .current_build_dir() / sleef_build_dir,
15
19
' -DCMAKE_BUILD_TYPE=Release' ,
16
20
' -DSLEEF_BUILD_QUAD=ON' ,
17
- ' -DBUILD_SHARED_LIBS =OFF' , # building & linnking statically
21
+ ' -DSLEEF_BUILD_SHARED_LIBS =OFF' ,
18
22
' -DSLEEF_BUILD_TESTS=OFF' ,
19
23
' -DSLEEF_BUILD_INLINE_HEADERS=OFF' ,
20
24
' -DCMAKE_POSITION_INDEPENDENT_CODE=ON' ,
@@ -25,26 +29,23 @@ if sleef_configure.returncode() != 0
25
29
error (' SLEEF CMake configuration failed: ' + sleef_configure.stderr())
26
30
endif
27
31
28
-
29
32
sleef_build_target = custom_target (' sleef_build' ,
30
33
command : [cmake, ' --build' , meson .current_build_dir() / sleef_build_dir, ' --target' , ' install' , ' --parallel' ],
31
- output : ' sleef_built.stamp' ,
34
+ output : ' sleef_built.stamp' , # Dummy stamp file
32
35
console : true ,
33
36
build_always_stale : true ,
34
37
build_by_default : true
35
38
)
36
39
37
40
sleef_include_path = meson .current_build_dir() / sleef_install_dir / ' include'
38
- sleef_lib_path = meson .current_build_dir() / sleef_install_dir / ' lib '
41
+ sleef_lib_path = meson .current_build_dir() / sleef_install_dir / libdir
39
42
40
43
sleef_build_dep = declare_dependency (sources : [sleef_build_target])
41
-
42
44
sleef_dep = declare_dependency (
43
- dependencies : [sleef_build_dep],
45
+ dependencies : [sleef_build_dep],
44
46
compile_args : [' -I' + sleef_include_path],
45
47
link_args : [' -L' + sleef_lib_path, ' -lsleef' ]
46
48
)
47
-
48
49
sleefquad_dep = declare_dependency (
49
50
dependencies : [sleef_build_dep],
50
51
compile_args : [' -I' + sleef_include_path],
0 commit comments