project: Minor meson improvements.

This patch makes some minor improvements to the meson build system.
The changes are as follows:

* Avoid conditional statements when setting config.h values.
* Ordered calendar dependencies.
* Reused variables derived from options.
* Removed unnecessary new line in the output at the configuration's
  end.
* Use set10 function avoiding the trinary operator.
* Removed dependencies on the libgcal dependency, as they are not
  needed.

https://bugzilla.gnome.org/show_bug.cgi?id=786481
This commit is contained in:
Iñigo Martínez
2017-08-18 23:06:29 -03:00
committed by Georges Basile Stavracas Neto
parent 29092fcfe6
commit 1b04e6f4f5
2 changed files with 11 additions and 16 deletions
+9 -13
View File
@@ -71,9 +71,7 @@ check_headers = [
]
foreach header: check_headers
if cc.has_header(header[1])
config_h.set(header[0], true)
endif
config_h.set(header[0], cc.has_header(header[1]))
endforeach
# functions
@@ -97,9 +95,7 @@ if host_machine.system().contains('darwin')
endif
foreach func: check_functions
if cc.has_function(func[1])
config_h.set(func[0], true)
endif
config_h.set(func[0], cc.has_function(func[1]))
endforeach
assert(cc.has_function('strerror'), '"strerror" not found')
@@ -161,17 +157,17 @@ glib_dep = dependency('glib-2.0', version: '>= 2.43.4')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.21.6')
calendar_deps = [
dependency('gmodule-export-2.0'),
dependency('gio-2.0', version: '>= 2.43.4'),
glib_dep,
dependency('goa-1.0', version: '>= 3.2.0'),
gtk_dep,
libical_dep,
dependency('gio-2.0', version: '>= 2.43.4'),
dependency('gmodule-export-2.0'),
dependency('goa-1.0', version: '>= 3.2.0'),
dependency('gsettings-desktop-schemas', version: '>= 3.21.2'),
dependency('libecal-1.2', version: '>= 3.13.90'),
dependency('libedataserver-1.2', version: '>= 3.17.1'),
dependency('libedataserverui-1.2', version: '>= 3.17.1'),
libical_dep,
dependency('libsoup-2.4'),
dependency('gsettings-desktop-schemas', version: '>= 3.21.2'),
cc.find_library('m')
]
@@ -193,7 +189,7 @@ subdir('data')
subdir('src')
subdir('po')
if get_option('enable-gtk-doc')
if enable_gtk_doc
subdir('doc/reference')
endif
@@ -208,5 +204,5 @@ output += ' Development options\n'
output += ' Enable Debug: .................... ' + calendar_debug.to_string() + '\n'
output += ' Enable Tracing: .................. ' + enable_tracing.to_string() + '\n'
output += ' Enable Documentation: ............ ' + enable_gtk_doc.to_string() + '\n\n'
output += ' Now type "ninja -C ' + meson.build_root() + '" to build ' + meson.project_name() + '\n'
output += ' Now type "ninja -C ' + meson.build_root() + '" to build ' + meson.project_name()
message(output)
+2 -3
View File
@@ -75,7 +75,7 @@ sources += gnome.gdbus_codegen(
debug_conf = configuration_data()
debug_conf.set('BUGREPORT_URL', package_bugreport)
debug_conf.set('ENABLE_TRACING', (enable_tracing ? 1 : 0))
debug_conf.set10('ENABLE_TRACING', enable_tracing)
debug = 'gcal-debug.h'
@@ -108,6 +108,5 @@ libgcal = shared_library(
libgcal_dep = declare_dependency(
link_with: libgcal,
include_directories: src_inc,
dependencies: calendar_deps
include_directories: src_inc
)