From 99b377d53825a178db73d7299c5721bd1ff65d36 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 5 Jun 2016 18:49:53 -0400 Subject: Set up the Windows builds. Almost working! --- dummy_windows.cpp | 2 ++ libui_windows_386.res | Bin 1952 -> 0 bytes libui_windows_386.res.o | Bin 0 -> 1952 bytes 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 9 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 dummy_windows.cpp delete mode 100644 libui_windows_386.res create mode 100644 libui_windows_386.res.o 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 deleted file mode 100644 index 4b03f64..0000000 Binary files a/libui_windows_386.res and /dev/null differ diff --git a/libui_windows_386.res.o b/libui_windows_386.res.o new file mode 100644 index 0000000..4b03f64 Binary files /dev/null and b/libui_windows_386.res.o differ 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 0000000..46c6ccc Binary files /dev/null and b/static_windows_386.o differ diff --git a/static_windows_amd64.o b/static_windows_amd64.o new file mode 100644 index 0000000..eb56b3b Binary files /dev/null and b/static_windows_amd64.o differ -- cgit v1.2.3