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 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