[pangomm/meson.msvc: 4/4] Meson: Don't use 'cp' in MSVC_NMake



commit 8f0e7fd2972be0e6257369c7cd52bdc2086c237a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Tue Oct 15 13:02:27 2019 +0800

    Meson: Don't use 'cp' in MSVC_NMake
    
    The 'cp' command is unfortunately not available in non-UNIXy shells, so
    use a Python script instead to do the same thing.

 MSVC_NMake/filelist.am                     |  1 +
 MSVC_NMake/pangomm/copy-pangommconfig-h.py | 13 +++++++++++++
 MSVC_NMake/pangomm/meson.build             |  4 +---
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/MSVC_NMake/filelist.am b/MSVC_NMake/filelist.am
index 04081fe..258fede 100644
--- a/MSVC_NMake/filelist.am
+++ b/MSVC_NMake/filelist.am
@@ -12,4 +12,5 @@ msvc_nmake_data =             \
        install.mak             \
        Makefile.vc             \
        pangomm/pangomm.rc      \
+       pangomm/copy-pangommconfig-h.py \
        pangomm/pangommconfig.h
diff --git a/MSVC_NMake/pangomm/copy-pangommconfig-h.py b/MSVC_NMake/pangomm/copy-pangommconfig-h.py
new file mode 100644
index 0000000..9a1920e
--- /dev/null
+++ b/MSVC_NMake/pangomm/copy-pangommconfig-h.py
@@ -0,0 +1,13 @@
+#! /usr/bin/env python3
+
+import os
+import sys
+from shutil import copyfile
+
+if len(sys.argv) != 3:
+   raise ValueError('build root directory and current build directory required')
+
+srcfile = os.path.join(sys.argv[1], 'pango', 'pangommconfig.h')
+destfile = os.path.join(sys.argv[2], 'pangommconfig.h')
+
+copyfile(srcfile, destfile)
diff --git a/MSVC_NMake/pangomm/meson.build b/MSVC_NMake/pangomm/meson.build
index 1353b51..b64b209 100644
--- a/MSVC_NMake/pangomm/meson.build
+++ b/MSVC_NMake/pangomm/meson.build
@@ -11,6 +11,4 @@ configure_file(
 
 # Copy the generated configuration header into the MSVC project directory.
 meson.add_postconf_script(
-  'cp', '-f', project_build_root / 'pango' / 'pangommconfig.h',
-  meson.current_build_dir()
-)
+  'copy-pangommconfig-h.py', project_build_root, meson.current_build_dir())


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