Skip to content

Commit d6df39b

Browse files
committed
Initial build file for windows cross compile
1 parent d51072d commit d6df39b

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/windows-x64.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Windows C/C++ CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name : mxe repo
16+
run: >
17+
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9 &&
18+
sudo add-apt-repository "deb [arch=amd64] https://pkg.mxe.cc/repos/apt `lsb_release -sc` main" &&
19+
sudo apt-get update
20+
21+
- name: qt_windows_x64
22+
run: sudo apt-get install mxe-x86-64-w64-mingw32.static-gcc mxe-x86-64-w64-mingw32.static-binutils premake4 qt5-qmake mxe-x86-64-w64-mingw32.static-qtbase mxe-x86-64-w64-mingw32.static-qtsvg
23+
- name: admesh
24+
run: >
25+
export PATH=/usr/lib/mxe/usr/bin:$PATH &&
26+
sudo mkdir -p /usr/mxe-x86-64-w64-mingw32.static &&
27+
git clone https://github.com/udif/admesh.git &&
28+
cd admesh && pwd &&
29+
./autogen.sh && ./configure --host=x86_64-w64-mingw32.static --prefix=/usr/mxe-x86-64-w64-mingw32.static &&
30+
make && sudo make install
31+
32+
- name: stlsplit
33+
# These are just snippets put aside for debugging
34+
#run: export PATH=/usr/lib/mxe/usr/bin:$PATH && git clone https://github.com/admesh/stlsplit && cd stlsplit && premake4 gmake2 && make && sudo cp stlsplit.h /usr/local/include && ls build && sudo cp -P build/libstlsplit.so* /usr/local/lib && sudo ldconfig
35+
# echo | x86_64-w64-mingw32.static-g++ -E -Wp,-v - &&
36+
# echo "PKG_CONFIG_PATH=" $PKG_CONFIG_PATH &&
37+
# echo "CFLAGS=" $CFLAGS "LDFLAGS=" $LDFLAGS &&
38+
# && find /usr/mxe* -type f
39+
# && ls /usr/mxe-x86-64-w64-mingw32.static/include/admesh
40+
run: >
41+
export PATH=/usr/lib/mxe/usr/bin:$PATH &&
42+
git clone https://github.com/udif/stlsplit &&
43+
cd stlsplit &&
44+
export PKG_CONFIG_PATH=../admesh &&
45+
export CFLAGS=$(x86_64-w64-mingw32.static-pkg-config libadmesh --cflags) &&
46+
export CXXFLAGS=$(x86_64-w64-mingw32.static-pkg-config libadmesh --cflags) &&
47+
export LDFLAGS=$(x86_64-w64-mingw32.static-pkg-config libadmesh --libs) &&
48+
./autogen.sh && ./configure --host=x86_64-w64-mingw32.static --prefix=/usr/mxe-x86-64-w64-mingw32.static &&
49+
make && sudo make install
50+
51+
- name: qmake
52+
run: >
53+
export PATH=/usr/lib/mxe/usr/bin:$PATH &&
54+
export PKG_CONFIG_PATH=./admesh &&
55+
ls /usr/mxe-x86-64-w64-mingw32.static/lib/pkgconfig &&
56+
export CFLAGS="$(x86_64-w64-mingw32.static-pkg-config libadmesh --cflags) $(x86_64-w64-mingw32.static-pkg-config libstlsplit --cflags)" &&
57+
export CXXFLAGS="$(x86_64-w64-mingw32.static-pkg-config libadmesh --cflags) $(x86_64-w64-mingw32.static-pkg-config libstlsplit --cflags)" &&
58+
export LDFLAGS=$(x86_64-w64-mingw32.static-pkg-config libadmesh --libs) &&
59+
/usr/lib/mxe/usr/x86_64-w64-mingw32.static/qt5/bin/qmake &&
60+
cat Makefile && cat Makefile.Release
61+
62+
- name: make
63+
run: export PATH=/usr/lib/mxe/usr/bin:$PATH && make
64+

ADMeshGUI.pro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 4) {
1717
error(ADMeshGUI requires Qt 5.4 to run. Older version detected.)
1818
}
1919

20+
QMAKE_CXXFLAGS += $$(CXXFLAGS)
21+
QMAKE_CFLAGS += $$(CFLAGS)
22+
QMAKE_LFLAGS += $$(LDFLAGS)
23+
2024
TARGET = admeshgui
2125
TEMPLATE = app
2226

0 commit comments

Comments
 (0)