@@ -3,18 +3,18 @@ project('sleef', version: '3.8')
3
3
cmake = find_program (' cmake' )
4
4
ninja = find_program (' ninja' , ' make' , required : false )
5
5
6
- # Use relative paths from build directory
6
+
7
7
sleef_build_dir = ' sleef_build'
8
8
sleef_install_dir = ' sleef_install'
9
9
10
- # Configure SLEEF at configuration time
10
+
11
11
sleef_configure = run_command ([
12
12
cmake,
13
13
' -S' , meson .current_source_dir(),
14
14
' -B' , meson .current_build_dir() / sleef_build_dir,
15
15
' -DCMAKE_BUILD_TYPE=Release' ,
16
16
' -DSLEEF_BUILD_QUAD=ON' ,
17
- ' -DBUILD_SHARED_LIBS=OFF' ,
17
+ ' -DBUILD_SHARED_LIBS=OFF' , # building & linnking statically
18
18
' -DSLEEF_BUILD_TESTS=OFF' ,
19
19
' -DSLEEF_BUILD_INLINE_HEADERS=OFF' ,
20
20
' -DCMAKE_POSITION_INDEPENDENT_CODE=ON' ,
@@ -25,31 +25,28 @@ if sleef_configure.returncode() != 0
25
25
error (' SLEEF CMake configuration failed: ' + sleef_configure.stderr())
26
26
endif
27
27
28
- # Build target for SLEEF libraries - create a dummy output file
28
+
29
29
sleef_build_target = custom_target (' sleef_build' ,
30
30
command : [cmake, ' --build' , meson .current_build_dir() / sleef_build_dir, ' --target' , ' install' , ' --parallel' ],
31
- output : ' sleef_built.stamp' , # Dummy stamp file
31
+ output : ' sleef_built.stamp' ,
32
32
console : true ,
33
33
build_always_stale : true ,
34
34
build_by_default : true
35
35
)
36
36
37
- # Path variables
38
37
sleef_include_path = meson .current_build_dir() / sleef_install_dir / ' include'
39
38
sleef_lib_path = meson .current_build_dir() / sleef_install_dir / ' lib'
40
39
41
- # Create a dependency that ensures the build happens but doesn't link the dummy file
42
40
sleef_build_dep = declare_dependency (sources : [sleef_build_target])
43
41
44
- # Create the actual linking dependencies
45
42
sleef_dep = declare_dependency (
46
- dependencies : [sleef_build_dep], # Ensures build happens first
43
+ dependencies : [sleef_build_dep],
47
44
compile_args : [' -I' + sleef_include_path],
48
45
link_args : [' -L' + sleef_lib_path, ' -lsleef' ]
49
46
)
50
47
51
48
sleefquad_dep = declare_dependency (
52
- dependencies : [sleef_build_dep], # Ensures build happens first
49
+ dependencies : [sleef_build_dep],
53
50
compile_args : [' -I' + sleef_include_path],
54
51
link_args : [' -L' + sleef_lib_path, ' -lsleefquad' ]
55
52
)
0 commit comments