[gobject-introspection/fix-pc-gen] meson.build: Fix generating pkg-config files



commit 266886b6ff16cb0760b7bc904a62d4eb9e030930
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Wed Jun 24 18:23:55 2020 +0800

    meson.build: Fix generating pkg-config files
    
    On Windows and Cygwin builds, we need to put the '.exe' for our entries
    into the pkg-config files for 'g-ir-compiler' and 'g-ir-generate',
    otherwise Meson will not be able to identify these programs correctly.

 meson.build | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index a6f3a02e..658727d8 100644
--- a/meson.build
+++ b/meson.build
@@ -230,12 +230,19 @@ install_data('m4/introspection.m4', install_dir: join_paths(get_option('datadir'
 
 pkg = import('pkgconfig')
 
+# We must put in the '.exe' extension for .exe executables
+exe_ext = ''
+
+if host_system == 'windows' or host_system == 'cygwin'
+  exe_ext = '.exe'
+endif
+
 pkgconfig_variables = [
   'datadir=' + '${prefix}' / get_option('datadir'),
   'bindir=' + '${prefix}' / get_option('bindir'),
   'g_ir_scanner=${bindir}/g-ir-scanner',
-  'g_ir_compiler=${bindir}/g-ir-compiler',
-  'g_ir_generate=${bindir}/g-ir-generate',
+  'g_ir_compiler=${bindir}/g-ir-compiler@0@'.format(exe_ext),
+  'g_ir_generate=${bindir}/g-ir-generate@0@'.format(exe_ext),
   'gidatadir=${datadir}/gobject-introspection-1.0',
   'girdir=' + gir_dir_pc_prefix / 'gir-1.0',
   'typelibdir=${libdir}/girepository-1.0',


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