From 1a246116ea5d519b1c8711447e16a87d620673dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Sun, 12 Nov 2017 10:56:10 +0100 Subject: [PATCH 1/3] project: Remove default warning level gnome-calendar uses 1 as the project's default warning level. However, meson already uses this level as the default warning level. This patch removes the warning level from project's default options. https://bugzilla.gnome.org/show_bug.cgi?id=790234 --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index 4c9e5224..276be940 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,6 @@ project( 'c', version: '3.27.2', license: 'GPL3+', - default_options: [ 'buildtype=debugoptimized', 'warning_level=1' ], meson_version: '>= 0.42.0' ) From 66b113ac83d204de44b4d3ee01a34d464c2cbc94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Sun, 12 Nov 2017 10:51:48 +0100 Subject: [PATCH 2/3] project: Rename build options Following the new meson porting guidelines, this patch renames the build options. The list of changes is as follows: - Remove the enable prefix from boolean options. - The character separator from multi-word options has been changed to underscore. https://bugzilla.gnome.org/show_bug.cgi?id=790234 --- configure | 2 +- meson.build | 4 ++-- meson_options.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 6ee3185a..fc9b359f 100755 --- a/configure +++ b/configure @@ -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} \ diff --git a/meson.build b/meson.build index 276be940..9b1aa15c 100644 --- a/meson.build +++ b/meson.build @@ -36,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') diff --git a/meson_options.txt b/meson_options.txt index b8d65a56..063b8cb0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') From 1dcda5087bf98449de8f15fdf3801230534875c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Sun, 12 Nov 2017 11:08:44 +0100 Subject: [PATCH 3/3] project: Remove unused defines meson generates the config.h file with multiple defines to be used as guards, in the same way as autotools does. However, some of them are not used. This patch removes those unused defines. https://bugzilla.gnome.org/show_bug.cgi?id=790234 --- meson.build | 64 ++++++++--------------------------------------------- 1 file changed, 9 insertions(+), 55 deletions(-) diff --git a/meson.build b/meson.build index 9b1aa15c..d936ad7e 100644 --- a/meson.build +++ b/meson.build @@ -62,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 @@ -133,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 += [ @@ -180,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') @@ -209,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'