Merge branch 'meson-improvements' into 'master'

Meson improvements

See merge request GNOME/gnome-calendar!25
This commit is contained in:
Georges Basile Stavracas Neto
2018-01-27 01:58:52 +00:00
3 changed files with 14 additions and 61 deletions
Vendored
+1 -1
View File
@@ -159,7 +159,7 @@ END
cmd_options=""
for key in "${!meson_options[@]}"; do
cmd_options="$cmd_options -Denable-$key=${meson_options[$key]}"
cmd_options="$cmd_options -D${key/\-/_}=${meson_options[$key]}"
done
exec ${MESON} \
+11 -58
View File
@@ -3,7 +3,6 @@ project(
'c',
version: '3.27.2',
license: 'GPL3+',
default_options: [ 'buildtype=debugoptimized', 'warning_level=1' ],
meson_version: '>= 0.42.0'
)
@@ -37,8 +36,8 @@ calendar_schemadir = join_paths(calendar_datadir, 'glib-2.0', 'schemas')
calendar_buildtype = get_option('buildtype')
calendar_debug = calendar_minor_version.is_odd() or buildtype.contains('debug')
enable_tracing = get_option('enable-tracing')
enable_gtk_doc = get_option('enable-gtk-doc')
enable_tracing = get_option('tracing')
enable_gtk_doc = get_option('gtk_doc')
cc = meson.get_compiler('c')
@@ -63,50 +62,6 @@ foreach define: set_defines
config_h.set_quoted(define[0], define[1])
endforeach
# headers
check_headers = [
['HAVE_DLFCN_H', 'dlfcn.h'],
['HAVE_INTTYPES_H', 'inttypes.h'],
['HAVE_LANGINFO_H', 'langinfo.h'],
['HAVE_LOCALE_H', 'locale.h'],
['HAVE_MEMORY_H', 'memory.h'],
['HAVE_STDINT_H', 'stdint.h'],
['HAVE_STDLIB_H', 'stdlib.h'],
['HAVE_STRINGS_H', 'strings.h'],
['HAVE_STRING_H', 'string.h'],
['HAVE_SYS_STAT_H', 'sys/stat.h'],
['HAVE_SYS_TYPES_H', 'sys/types.h'],
['HAVE_UNISTD_H', 'unistd.h']
]
foreach header: check_headers
config_h.set(header[0], cc.has_header(header[1]))
endforeach
# functions
check_functions = [
['HAVE_DCGETTEXT', 'dcgettext'],
['HAVE_GETTEXT', 'gettext'],
['HAVE_FLOOR', 'floor'],
['HAVE_ICONV', 'iconv'],
['HAVE_MEMSET', 'memset'],
['HAVE_NL_LANGINFO', 'nl_langinfo'],
['HAVE_POW', 'pow'],
['HAVE_SETLOCALE', 'setlocale'],
['HAVE_STRSTR', 'strstr']
]
if host_machine.system().contains('darwin')
check_functions += [
['HAVE_CFLOCALECOPYCURRENT', 'CFLocaleCopyCurrent'],
['HAVE_CFPREFERENCESCOPYAPPVALUE', 'CFPreferencesCopyAppValue']
]
endif
foreach func: check_functions
config_h.set(func[0], cc.has_function(func[1]))
endforeach
assert(cc.has_function('strerror'), '"strerror" not found')
# options
@@ -134,13 +89,11 @@ common_flags = [
'-DGWEATHER_I_KNOW_THIS_IS_UNSTABLE'
]
test_cflags = ['-Wno-sign-compare']
test_cflags = '-Wno-sign-compare'
foreach cflag: test_cflags
if cc.has_argument(cflag)
common_flags += [cflag]
endif
endforeach
if cc.has_argument(cflag)
common_flags += [cflag]
endif
if calendar_debug
common_flags += [
@@ -181,11 +134,6 @@ geoclue_dep = dependency('libgeoclue-2.0', version: '>=2.4')
geocode_dep = dependency('geocode-glib-1.0', version: '>=3.23')
m_dep = cc.find_library('m')
configure_file(
output: 'config.h',
configuration: config_h
)
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
@@ -210,6 +158,11 @@ if enable_gtk_doc
subdir('doc/reference')
endif
configure_file(
output: 'config.h',
configuration: config_h
)
meson.add_install_script('meson_post_install.py')
output = '\n\n GNOME Calendar ' + calendar_version + '\n'
+2 -2
View File
@@ -1,2 +1,2 @@
option('enable-tracing', type: 'boolean', value: false, description: 'add extra debugging information')
option('enable-gtk-doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')
option('tracing', type: 'boolean', value: false, description: 'add extra debugging information')
option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation')