From 99b377d53825a178db73d7299c5721bd1ff65d36 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 5 Jun 2016 18:49:53 -0400 Subject: [PATCH] Set up the Windows builds. Almost working! --- dummy_windows.cpp | 2 ++ ...windows_386.res => libui_windows_386.res.o | Bin link_windows_386.go | 12 +++++++ link_windows_amd64.go | 4 +-- static.manifest | 32 ++++++++++++++++++ static.rc | 3 ++ static_windows_386.o | Bin 0 -> 1308 bytes static_windows_amd64.o | Bin 0 -> 1308 bytes 8 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 dummy_windows.cpp rename libui_windows_386.res => libui_windows_386.res.o (100%) create mode 100644 link_windows_386.go create mode 100644 static.manifest create mode 100644 static.rc create mode 100644 static_windows_386.o create mode 100644 static_windows_amd64.o diff --git a/dummy_windows.cpp b/dummy_windows.cpp new file mode 100644 index 0000000..a338f7f --- /dev/null +++ b/dummy_windows.cpp @@ -0,0 +1,2 @@ +// 5 june 2016 +// This file is only present to force cgo to use the C++ linker instead of the C linker on Windows. diff --git a/libui_windows_386.res b/libui_windows_386.res.o similarity index 100% rename from libui_windows_386.res rename to libui_windows_386.res.o diff --git a/link_windows_386.go b/link_windows_386.go new file mode 100644 index 0000000..3ea6183 --- /dev/null +++ b/link_windows_386.go @@ -0,0 +1,12 @@ +// 13 december 2015 + +package ui + +// #cgo LDFLAGS: ${SRCDIR}/static_windows_386.o ${SRCDIR}/libui_windows_386.a ${SRCDIR}/libui_windows_386.res.o +// /* note the order; also note the lack of uuid */ +// #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++ +import "C" + +func ensureMainThread() { + // do nothing; Windows doesn't care which thread we're on so long as we don't change it after starting +} diff --git a/link_windows_amd64.go b/link_windows_amd64.go index 7a9c08d..1992ae7 100644 --- a/link_windows_amd64.go +++ b/link_windows_amd64.go @@ -2,9 +2,9 @@ package ui -// #cgo LDFLAGS: ${SRCDIR}/libui_windows_amd64.lib ${SRCDIR}/libui_windows_amd64.res.o +// #cgo LDFLAGS: ${SRCDIR}/static_windows_amd64.o ${SRCDIR}/libui_windows_amd64.a ${SRCDIR}/libui_windows_amd64.res.o // /* note the order; also note the lack of uuid */ -// #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -lmsvcrt +// #cgo LDFLAGS: -luser32 -lkernel32 -lusp10 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -static -static-libgcc -static-libstdc++ import "C" func ensureMainThread() { diff --git a/static.manifest b/static.manifest new file mode 100644 index 0000000..d8e83a8 --- /dev/null +++ b/static.manifest @@ -0,0 +1,32 @@ + + + +Your application description here. + + + + + + + + + + + + + + + + diff --git a/static.rc b/static.rc new file mode 100644 index 0000000..ca23375 --- /dev/null +++ b/static.rc @@ -0,0 +1,3 @@ +/* 5 june 2016 */ +#pragma code_page(65001) +1 24 "static.manifest" diff --git a/static_windows_386.o b/static_windows_386.o new file mode 100644 index 0000000000000000000000000000000000000000..46c6ccca8f0f39568b1ccf7f9f1049426b0022f4 GIT binary patch literal 1308 zcmbW1UvJYe5WrJ0K=c#v=;aZ~Y0@TLJEh&GO^As)?TCU9qpG!)Rve5``b_hAZh_l{#+Y6-yONc-I9FxG z5>@_ZkQf6VUHh^|Bz9ywD-}ZGiO;nU z#slZ1{~{2RI4QAxzO(Osce40-;5m8n*z?-ip%-YQd82KA_lKUB;`A4ePMqBfFT8j2 zog8@2aDm^CozBe;8vF1s`loo_E4288-(r2X^GHv>mIb*3ZE_{2eiVd00m+rfX6n~ko*2G>k{Md&Tq~n8OSvjfm??w1 z$R{O}c?QPb>|eHb(xm`tbGzyhl>LZ;5Tk0el~x>#QTj~tMQ(xHT4PMl+g-^@T%4=2 zVsiBs7r{HNM9pn8|Ey|#R#ipLnZ;aN7rUy^Wtq$2!0+`j7y*XsymA&Z=Rw%ch3svT z1!xG;{+QeAQx9e0tkZHb6bo^E{R=$!)S9(I5R*fZ7!=oV%B^$YtqBpTZKJa z({1$*$QF19liP99$)i=Z|CY&{O+kW>xfE(?0;E(bNzawES{0_Hv2onOA35|J_?z8- z7h!8v&k^-&SY4|xfSol;CdqshM{&$~7KyBTW5MKY&2D$KbjM&l+~6Spfn}$3@KPjQ zA>4UhU;{nek{xr`oa>wRioHkvh|+5;-{l3FL!p*fPT`seOs6?aT~$h3k||Brl*vtw zHE(L|5^<8Q%|KkeCzoRCe}h37MR9UWqa+^Dc*qmVk_>1Vjs*Y=#V`xM`)d}>5&s|0 z@dL38lV~`ePZ&+a1Y^nOf{tMzC>z9aI2a_^WXQI$r2P)AwBMnMMd@$eh*_`a-X159 OIxn7k-5z=FIr