[geary: 1/2] Fix valac preprocessor conditionals



commit a0b211193ac4fc58b0b66f959a2145f211d51644
Author: Christian Kellner <christian kellner me>
Date:   Tue Feb 26 09:39:39 2019 +0100

    Fix valac preprocessor conditionals
    
    Two preprocessor conditionals for vala source files were defined
    in config.h, which is not picked up during vala compilation. Now,
    pass the defines as command line options to valac. Fixes #264

 meson.build            | 2 --
 src/client/meson.build | 6 +++++-
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index b83eb445..ff871e3a 100644
--- a/meson.build
+++ b/meson.build
@@ -144,8 +144,6 @@ conf.set_quoted('_WEB_EXTENSIONS_DIR', web_extensions_dir)
 conf.set_quoted('LANGUAGE_SUPPORT_DIRECTORY', locale_dir)
 conf.set_quoted('ISO_CODE_639_XML', iso_639_xml)
 conf.set_quoted('ISO_CODE_3166_XML', iso_3166_xml)
-conf.set('HAVE_LIBMESSAGINGMENU', libmessagingmenu.found())
-conf.set('HAVE_LIBUNITY', libunity.found())
 conf.set('HAVE_FTS3_TOKENIZE', true)
 conf.set('VERSION', meson.project_version())
 conf.set('GCR_API_SUBJECT_TO_CHANGE', true)
diff --git a/src/client/meson.build b/src/client/meson.build
index 424ae473..72c8125b 100644
--- a/src/client/meson.build
+++ b/src/client/meson.build
@@ -127,6 +127,8 @@ geary_client_dependencies = [
   geary_engine_dep,
 ]
 
+geary_client_vala_options = geary_vala_options
+
 if libmessagingmenu.found()
   messagingmenu_vapi = meson.get_compiler('vala').find_library(
       'MessagingMenu-1.0',
@@ -135,16 +137,18 @@ if libmessagingmenu.found()
   )
   geary_client_dependencies += libmessagingmenu
   geary_client_dependencies += messagingmenu_vapi
+  geary_client_vala_options += ['-D', 'HAVE_LIBMESSAGINGMENU']
 endif
 if libunity.found()
   geary_client_dependencies += libunity
+  geary_client_vala_options += ['-D', 'HAVE_LIBUNITY']
 endif
 
 geary_client_lib = static_library('geary-client',
   geary_client_sources,
   dependencies: geary_client_dependencies,
   include_directories: config_h_dir,
-  vala_args: geary_vala_options,
+  vala_args: geary_client_vala_options,
   c_args: geary_c_options,
 )
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]