Skip to content

Commit 439fcfc

Browse files
authored
Merge pull request #1329 from marv7000/fix-meson-warnings
meta: Fix some meson warnings
2 parents acb4e69 + 7b4c14b commit 439fcfc

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

meson.build

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project('mlibc', default_options: ['warning_level=2', 'c_std=gnu11', 'cpp_std=c++20'])
1+
project('mlibc', default_options: ['warning_level=2', 'c_std=gnu11', 'cpp_std=c++20'], meson_version: '>=1.3.0')
22

33
fs = import('fs')
44

@@ -35,7 +35,8 @@ internal_conf = configuration_data()
3535
mlibc_conf = configuration_data()
3636

3737
if not headers_only
38-
add_languages('c', 'cpp')
38+
add_languages('c', 'cpp', native: true)
39+
add_languages('c', 'cpp', native: false)
3940
c_compiler = meson.get_compiler('c')
4041
cpp_compiler = meson.get_compiler('cpp')
4142

@@ -562,8 +563,8 @@ endif
562563
hdoc = find_program('hdoc', required: false)
563564

564565
conf_data = configuration_data()
565-
conf_data.set('source_root', meson.source_root())
566-
conf_data.set('build_root', meson.build_root())
566+
conf_data.set('source_root', meson.global_source_root())
567+
conf_data.set('build_root', meson.global_build_root())
567568
configure_file(input: 'scripts/hdoc.toml.in',
568569
output: '.hdoc.toml', configuration: conf_data)
569570

tests/meson.build

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ else
223223
link_with: libc_shared,
224224
dependencies: [libc_deps, rtlib_deps]
225225
)
226-
test_link_args += ['-Wl,--dynamic-linker=' + meson.build_root() + '/ld.so']
226+
test_link_args += ['-Wl,--dynamic-linker=' + meson.global_build_root() + '/ld.so']
227227

228228
if host_machine.system() in ['linux']
229229
use_pie = true
@@ -264,7 +264,7 @@ foreach test_name : all_test_cases
264264
exec = executable(test_exec_name, [test_name + '.c', test_sources],
265265
dependencies: libc_dep,
266266
objects: test_objects,
267-
build_rpath: meson.build_root(),
267+
build_rpath: meson.global_build_root(),
268268
override_options: test_override_options,
269269
c_args: test_c_args,
270270
link_args: test_link_args,
@@ -277,7 +277,7 @@ foreach test_name : all_test_cases
277277
suite: test_subdir,
278278
should_fail: should_fail,
279279
args: [
280-
meson.source_root() + '/tests/' + test_name + '.py',
280+
meson.global_source_root() + '/tests/' + test_name + '.py',
281281
exec
282282
],
283283
timeout: timeout_sec,
@@ -300,7 +300,7 @@ foreach test_name : all_test_cases
300300
endif
301301

302302
exec = executable('host-libc-' + test_exec_name, test_name + '.c',
303-
build_rpath: meson.build_root(),
303+
build_rpath: meson.global_build_root(),
304304
override_options: host_libc_sanitize_options,
305305
c_args: [host_test_c_args + '-D_GNU_SOURCE', '-DUSE_HOST_LIBC', '-pthread', extra_cflags],
306306
link_args: ['-lresolv', '-ldl', '-pthread', '-lm', '-lrt'],

tests/rtld/ld_library_path/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
test_rpath = '$ORIGIN/'
66

7-
test_ld_path = meson.build_root() / 'tests' / 'rtld' / test_name
7+
test_ld_path = meson.global_build_root() / 'tests' / 'rtld' / test_name
88
test_env += ['LD_LIBRARY_PATH=' + test_ld_path]
99
test_native_env += ['LD_LIBRARY_PATH=' + test_ld_path]
1010

tests/rtld/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ host_libc_rtld_nosan_test_cases = [
2323
]
2424

2525
foreach test_name : rtld_test_cases
26-
test_rpath = meson.build_root() / 'tests' / 'rtld' / test_name / ''
26+
test_rpath = meson.global_build_root() / 'tests' / 'rtld' / test_name / ''
2727
test_rpath += ':$ORIGIN/' # Workaround old and buggy qemu-user on CI
2828

2929
test_env = []

0 commit comments

Comments
 (0)