@@ -3,11 +3,15 @@ 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
7
6
sleef_build_dir = ' sleef_build'
8
7
sleef_install_dir = ' sleef_install'
9
8
10
- # Configure SLEEF at configuration time
9
+ # turning off parallel build in windows
10
+ parallel_flag = [' --parallel' ]
11
+ if host_machine .system() == ' windows'
12
+ parallel_flag = []
13
+ endif
14
+
11
15
sleef_configure = run_command ([
12
16
cmake,
13
17
' -S' , meson .current_source_dir(),
@@ -25,22 +29,18 @@ if sleef_configure.returncode() != 0
25
29
error (' SLEEF CMake configuration failed: ' + sleef_configure.stderr())
26
30
endif
27
31
28
- # Build target for SLEEF libraries - create a dummy output file
29
32
sleef_build_target = custom_target (' sleef_build' ,
30
- command : [cmake, ' --build' , meson .current_build_dir() / sleef_build_dir, ' --target' , ' install' , ' --parallel ' ] ,
31
- output : ' sleef_built.stamp' , # Dummy stamp file
33
+ command : [cmake, ' --build' , meson .current_build_dir() / sleef_build_dir, ' --target' , ' install' ] + parallel_flag ,
34
+ output : ' sleef_built.stamp' ,
32
35
console : true ,
33
36
build_always_stale : true ,
34
37
build_by_default : true
35
38
)
36
39
37
- # Path variables
38
40
sleef_include_path = meson .current_build_dir() / sleef_install_dir / ' include'
39
41
40
- # Create a dependency that ensures the build happens but doesn't link the dummy file
41
42
sleef_build_dep = declare_dependency (sources : [sleef_build_target])
42
43
43
- # Platform-specific define for static linking on Windows
44
44
sleef_static_define = ''
45
45
if host_machine .system() == ' windows'
46
46
sleef_static_define = ' -DSLEEF_STATIC_LIBS'
@@ -52,13 +52,13 @@ if sleef_static_define != ''
52
52
endif
53
53
54
54
sleef_dep = declare_dependency (
55
- dependencies : [sleef_build_dep], # Ensures build happens first
55
+ dependencies : [sleef_build_dep],
56
56
compile_args : compile_args_list,
57
- link_args : [' -L' + meson .current_build_dir() / sleef_install_dir / ' lib' , ' -L' + meson .current_build_dir() / sleef_install_dir / ' lib64' , ' -lsleef' ]
57
+ link_args : [' -L' + meson .current_build_dir() / sleef_install_dir / ' lib' , ' -L' + meson .current_build_dir() / sleef_install_dir / ' lib64' , ' -lsleef' ] #both lib and lib64 because of ubuntu vs redhat compatibility
58
58
)
59
59
60
60
sleefquad_dep = declare_dependency (
61
- dependencies : [sleef_build_dep], # Ensures build happens first
61
+ dependencies : [sleef_build_dep],
62
62
compile_args : compile_args_list,
63
63
link_args : [' -L' + meson .current_build_dir() / sleef_install_dir / ' lib' , ' -L' + meson .current_build_dir() / sleef_install_dir / ' lib64' , ' -lsleefquad' ]
64
64
)
0 commit comments