build: add cross-file for MinGW-w64
authorDmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Thu, 27 Feb 2020 04:25:35 +0000 (07:25 +0300)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 18 Mar 2020 00:20:48 +0000 (01:20 +0100)
Add Meson configuration to cross-compile for Windows using MinGW-w64.
It may require adjustments in some cases, but at least it provides
the foundation.

Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: William Tu <u9012063@gmail.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
config/x86/meson_mingw.txt [new file with mode: 0644]
doc/guides/windows_gsg/build_dpdk.rst

diff --git a/config/x86/meson_mingw.txt b/config/x86/meson_mingw.txt
new file mode 100644 (file)
index 0000000..fac33cf
--- /dev/null
@@ -0,0 +1,13 @@
+[binaries]
+c = '/usr/bin/x86_64-w64-mingw32-gcc'
+cpp = '/usr/bin/x86_64-w64-mingw32-g++'
+ld = '/usr/bin/x86_64-w64-mingw32-ld'
+ar = '/usr/bin/x86_64-w64-mingw32-ar'
+strip = '/usr/bin/x86_64-w64-mingw32-strip'
+pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
+
+[host_machine]
+system = 'windows'
+cpu_family = 'x86_64'
+cpu = 'native'
+endian = 'little'
index a0e51df..d46e84e 100644 (file)
@@ -101,6 +101,17 @@ To compile the examples, the flag ``-Dexamples`` is required.
     meson -Dexamples=helloworld build
     ninja -C build
 
+Option 2. Cross-Compile with MinGW-w64
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The cross-file option must be specified for Meson.
+Depending on the distribution, paths in this file may need adjustments.
+
+.. code-block:: console
+
+    meson --cross-file config/x86/meson_mingw.txt -Dexamples=helloworld build
+    ninja -C build
+
 
 Run the helloworld example
 ==========================