@@ -3,18 +3,18 @@ project('sleef', version: '3.8')
33cmake = find_program (' cmake' )
44ninja = find_program (' ninja' , ' make' , required : false )
55
6- # Use relative paths from build directory
6+
77sleef_build_dir = ' sleef_build'
88sleef_install_dir = ' sleef_install'
99
10- # Configure SLEEF at configuration time
10+
1111sleef_configure = run_command ([
1212 cmake,
1313 ' -S' , meson .current_source_dir(),
1414 ' -B' , meson .current_build_dir() / sleef_build_dir,
1515 ' -DCMAKE_BUILD_TYPE=Release' ,
1616 ' -DSLEEF_BUILD_QUAD=ON' ,
17- ' -DBUILD_SHARED_LIBS=OFF' ,
17+ ' -DBUILD_SHARED_LIBS=OFF' , # building & linnking statically
1818 ' -DSLEEF_BUILD_TESTS=OFF' ,
1919 ' -DSLEEF_BUILD_INLINE_HEADERS=OFF' ,
2020 ' -DCMAKE_POSITION_INDEPENDENT_CODE=ON' ,
@@ -25,31 +25,28 @@ if sleef_configure.returncode() != 0
2525 error (' SLEEF CMake configuration failed: ' + sleef_configure.stderr())
2626endif
2727
28- # Build target for SLEEF libraries - create a dummy output file
28+
2929sleef_build_target = custom_target (' sleef_build' ,
3030 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' ,
3232 console : true ,
3333 build_always_stale : true ,
3434 build_by_default : true
3535)
3636
37- # Path variables
3837sleef_include_path = meson .current_build_dir() / sleef_install_dir / ' include'
3938sleef_lib_path = meson .current_build_dir() / sleef_install_dir / ' lib'
4039
41- # Create a dependency that ensures the build happens but doesn't link the dummy file
4240sleef_build_dep = declare_dependency (sources : [sleef_build_target])
4341
44- # Create the actual linking dependencies
4542sleef_dep = declare_dependency (
46- dependencies : [sleef_build_dep], # Ensures build happens first
43+ dependencies : [sleef_build_dep],
4744 compile_args : [' -I' + sleef_include_path],
4845 link_args : [' -L' + sleef_lib_path, ' -lsleef' ]
4946)
5047
5148sleefquad_dep = declare_dependency (
52- dependencies : [sleef_build_dep], # Ensures build happens first
49+ dependencies : [sleef_build_dep],
5350 compile_args : [' -I' + sleef_include_path],
5451 link_args : [' -L' + sleef_lib_path, ' -lsleefquad' ]
5552)
0 commit comments