[gedit] build: use host_machine.system() instead of GDK windowing targets



commit 9aed4c2c031bd2d918e6787c979ba8e76081b62b
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Dec 5 16:49:21 2019 +0100

    build: use host_machine.system() instead of GDK windowing targets
    
    To simplify the code.
    
    Not tested on Windows or macOS.

 gedit/meson.build                      |  6 +++---
 gedit/resources/meson.build            |  3 ++-
 meson.build                            | 18 +++++-------------
 plugins/externaltools/data/meson.build |  4 ++--
 plugins/meson.build                    |  2 +-
 5 files changed, 13 insertions(+), 20 deletions(-)
---
diff --git a/gedit/meson.build b/gedit/meson.build
index c5149bd09..33690f0e6 100644
--- a/gedit/meson.build
+++ b/gedit/meson.build
@@ -122,7 +122,7 @@ libgedit_deps = [
   libgd_dep,
 ]
 
-if windowing_target == 'quartz'
+if host_machine.system() == 'darwin'
   libgedit_sources += files(
     'gedit-app-osx.m',
     'gedit-file-chooser-dialog-osx.m',
@@ -138,7 +138,7 @@ if windowing_target == 'quartz'
   libgedit_deps += [
     gtk_mac_integration_dep,
   ]
-elif windowing_target == 'win32'
+elif host_machine.system() == 'windows'
   libgedit_sources += files(
     'gedit-app-win32.c',
   )
@@ -289,7 +289,7 @@ gedit_sources = [
 
 gedit_c_args = []
 
-if windowing_target == 'quartz'
+if host_machine.system() == 'darwin'
   gedit_c_args += [
     '-DOS_OSX=1',
   ]
diff --git a/gedit/resources/meson.build b/gedit/resources/meson.build
index 476a75bbe..4edb0dc55 100644
--- a/gedit/resources/meson.build
+++ b/gedit/resources/meson.build
@@ -1,5 +1,6 @@
 gresource_xml = configuration_data()
-if windowing_targets.contains('quartz')
+
+if host_machine.system() == 'darwin'
   gresource_xml.set(
     'OS_DEPENDENT_RESOURCE_FILES',
     '<file preprocess="xml-stripblanks">gtk/menus-traditional.ui</file>'
diff --git a/meson.build b/meson.build
index fe85212f1..200bafb97 100644
--- a/meson.build
+++ b/meson.build
@@ -53,7 +53,6 @@ glib_dep = dependency('glib-2.0', version: glib_req)
 gobject_dep = dependency('gobject-2.0', version: glib_req)
 gmodule_dep = dependency('gmodule-2.0', version: glib_req)
 gio_dep = dependency('gio-2.0', version: glib_req)
-gdk_dep = dependency('gdk-3.0', version: gtk_req)
 gtk_dep = dependency('gtk+-3.0', version: gtk_req)
 gtksourceview_dep = dependency('gtksourceview-4', version: '>= 4.0.2')
 tepl_dep = dependency('tepl-4', version: '>= 4.3')
@@ -72,17 +71,10 @@ vapigen_dep = dependency('vapigen', version: '>= 0.25.1', required: false)
 python3 = python.find_installation('python3')
 
 # Configurations
-windowing_targets = gdk_dep.get_pkgconfig_variable('targets').split()
-if windowing_targets.contains('quartz')
-  windowing_target = 'quartz'
-elif windowing_targets.contains('win32')
-  windowing_target = 'win32'
-else
-  if not x11_dep.found()
-    error('Native dependency \'x11\' not found')
-  else
-    windowing_target = 'x11'
-  endif
+if ((host_machine.system() != 'darwin') and
+    (host_machine.system() != 'windows') and
+    (not x11_dep.found()))
+  error('Native dependency \'x11\' not found.')
 endif
 
 config_h = configuration_data()
@@ -129,7 +121,7 @@ active_plugins = [
   'time',
 ]
 
-if windowing_target == 'win32'
+if host_machine.system() == 'windows'
   active_plugins += 'checkupdate'
 endif
 
diff --git a/plugins/externaltools/data/meson.build b/plugins/externaltools/data/meson.build
index 54762fa96..02d5d6cc1 100644
--- a/plugins/externaltools/data/meson.build
+++ b/plugins/externaltools/data/meson.build
@@ -4,11 +4,11 @@ externaltools_tools = [
   'send-to-fpaste',
 ]
 
-if windowing_target == 'quartz'
+if host_machine.system() == 'darwin'
   externaltools_tools += [
     'open-terminal-here-osx',
   ]
-elif windowing_target != 'win32'
+elif host_machine.system() != 'windows'
   externaltools_tools += [
     'open-terminal-here',
     'run-command',
diff --git a/plugins/meson.build b/plugins/meson.build
index af94ab775..f940a5e92 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -8,7 +8,7 @@ msgfmt_plugin_cmd = [
   '--output=@OUTPUT@'
 ]
 
-if windowing_target == 'win32'
+if host_machine.system() == 'windows'
   subdir('checkupdate')
 endif
 


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