@@ -3,11 +3,15 @@ project('sleef', version: '3.8')
33cmake = find_program (' cmake' )
44ninja = find_program (' ninja' , ' make' , required : false )
55
6- # Use relative paths from build directory
76sleef_build_dir = ' sleef_build'
87sleef_install_dir = ' sleef_install'
98
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+
1115sleef_configure = run_command ([
1216 cmake,
1317 ' -S' , meson .current_source_dir(),
@@ -25,22 +29,18 @@ if sleef_configure.returncode() != 0
2529 error (' SLEEF CMake configuration failed: ' + sleef_configure.stderr())
2630endif
2731
28- # Build target for SLEEF libraries - create a dummy output file
2932sleef_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' ,
3235 console : true ,
3336 build_always_stale : true ,
3437 build_by_default : true
3538)
3639
37- # Path variables
3840sleef_include_path = meson .current_build_dir() / sleef_install_dir / ' include'
3941
40- # Create a dependency that ensures the build happens but doesn't link the dummy file
4142sleef_build_dep = declare_dependency (sources : [sleef_build_target])
4243
43- # Platform-specific define for static linking on Windows
4444sleef_static_define = ''
4545if host_machine .system() == ' windows'
4646 sleef_static_define = ' -DSLEEF_STATIC_LIBS'
@@ -52,13 +52,13 @@ if sleef_static_define != ''
5252endif
5353
5454sleef_dep = declare_dependency (
55- dependencies : [sleef_build_dep], # Ensures build happens first
55+ dependencies : [sleef_build_dep],
5656 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
5858)
5959
6060sleefquad_dep = declare_dependency (
61- dependencies : [sleef_build_dep], # Ensures build happens first
61+ dependencies : [sleef_build_dep],
6262 compile_args : compile_args_list,
6363 link_args : [' -L' + meson .current_build_dir() / sleef_install_dir / ' lib' , ' -L' + meson .current_build_dir() / sleef_install_dir / ' lib64' , ' -lsleefquad' ]
6464)
0 commit comments