mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
Merge branch 'wip/pwithnall/meson-cleanups' into 'main'
build: Remove a few Meson workarounds and FIXMEs See merge request GNOME/glib!2653
This commit is contained in:
commit
d0e1131397
@ -147,16 +147,11 @@ if get_option('gtk_doc')
|
|||||||
configuration: version_conf
|
configuration: version_conf
|
||||||
)
|
)
|
||||||
|
|
||||||
# FIXME: configure_file() does not support more than one file in input
|
|
||||||
# argument. If input argument is omitted then meson checks that all items in
|
|
||||||
# the command array are strings. But if we have an input then extra files
|
|
||||||
# can be passed in command array.
|
|
||||||
# See https://github.com/mesonbuild/meson/issues/5893
|
|
||||||
concat_files_helper = find_program('concat-files-helper.py')
|
concat_files_helper = find_program('concat-files-helper.py')
|
||||||
configure_file(
|
configure_file(
|
||||||
output : 'gio-sections.txt',
|
output : 'gio-sections.txt',
|
||||||
input : sections_files[0],
|
input : sections_files,
|
||||||
command : [concat_files_helper, '@OUTPUT@'] + sections_files,
|
command : [concat_files_helper, '@OUTPUT@', '@INPUT@'],
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
|
50
meson.build
50
meson.build
@ -337,9 +337,9 @@ foreach h : headers
|
|||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
# FIXME: Use cc.check_header from Meson 0.47.
|
# FreeBSD includes a malloc.h which always throws compilation error, so we have
|
||||||
# FreeBSD includes a malloc.h which always throw compilation error.
|
# to use check_header() rather than has_header().
|
||||||
if cc.compiles('#include <malloc.h>', name : 'malloc.h')
|
if cc.check_header('malloc.h')
|
||||||
glib_conf.set('HAVE_MALLOC_H', 1)
|
glib_conf.set('HAVE_MALLOC_H', 1)
|
||||||
glib_conf_prefix = glib_conf_prefix + '#define HAVE_MALLOC_H 1\n'
|
glib_conf_prefix = glib_conf_prefix + '#define HAVE_MALLOC_H 1\n'
|
||||||
endif
|
endif
|
||||||
@ -1511,52 +1511,20 @@ g_sizet_compatibility = {
|
|||||||
# Do separate checks for gcc/clang (and ignore other compilers for now), since
|
# Do separate checks for gcc/clang (and ignore other compilers for now), since
|
||||||
# we need to explicitly pass -Werror to the compilers.
|
# we need to explicitly pass -Werror to the compilers.
|
||||||
# FIXME: https://github.com/mesonbuild/meson/issues/5399
|
# FIXME: https://github.com/mesonbuild/meson/issues/5399
|
||||||
# We can’t simplify these checks using a foreach loop because dictionary keys
|
|
||||||
# have to be string literals.
|
|
||||||
# FIXME: https://github.com/mesonbuild/meson/issues/5231
|
|
||||||
if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
|
||||||
g_sizet_compatibility += {
|
foreach type_name, size_compatibility : g_sizet_compatibility
|
||||||
'short': g_sizet_compatibility['short'] and cc.compiles(
|
g_sizet_compatibility += { type_name: size_compatibility and
|
||||||
|
cc.compiles(
|
||||||
'''#include <stddef.h>
|
'''#include <stddef.h>
|
||||||
size_t f (size_t *i) { return *i + 1; }
|
size_t f (size_t *i) { return *i + 1; }
|
||||||
int main (void) {
|
int main (void) {
|
||||||
unsigned short i = 0;
|
unsigned ''' + type_name + ''' i = 0;
|
||||||
f (&i);
|
f (&i);
|
||||||
return 0;
|
return 0;
|
||||||
}''',
|
}''',
|
||||||
args: ['-Werror'],
|
args: ['-Werror'],
|
||||||
name : 'GCC size_t typedef is short'),
|
name : 'GCC size_t typedef is ' + type_name), }
|
||||||
'int': g_sizet_compatibility['int'] and cc.compiles(
|
endforeach
|
||||||
'''#include <stddef.h>
|
|
||||||
size_t f (size_t *i) { return *i + 1; }
|
|
||||||
int main (void) {
|
|
||||||
unsigned int i = 0;
|
|
||||||
f (&i);
|
|
||||||
return 0;
|
|
||||||
}''',
|
|
||||||
args: ['-Werror'],
|
|
||||||
name : 'GCC size_t typedef is int'),
|
|
||||||
'long': g_sizet_compatibility['long'] and cc.compiles(
|
|
||||||
'''#include <stddef.h>
|
|
||||||
size_t f (size_t *i) { return *i + 1; }
|
|
||||||
int main (void) {
|
|
||||||
unsigned long i = 0;
|
|
||||||
f (&i);
|
|
||||||
return 0;
|
|
||||||
}''',
|
|
||||||
args: ['-Werror'],
|
|
||||||
name : 'GCC size_t typedef is long'),
|
|
||||||
'long long': g_sizet_compatibility['long long'] and cc.compiles(
|
|
||||||
'''#include <stddef.h>
|
|
||||||
size_t f (size_t *i) { return *i + 1; }
|
|
||||||
int main (void) {
|
|
||||||
unsigned long long i = 0;
|
|
||||||
f (&i);
|
|
||||||
return 0;
|
|
||||||
}''',
|
|
||||||
args: ['-Werror'],
|
|
||||||
name : 'GCC size_t typedef is long long'),
|
|
||||||
}
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g_sizet_compatibility['short']
|
if g_sizet_compatibility['short']
|
||||||
|
Loading…
Reference in New Issue
Block a user