Skip to content

Commit

Permalink
Set up the Windows builds. Almost working!
Browse files Browse the repository at this point in the history
  • Loading branch information
andlabs committed Jun 5, 2016
1 parent bcef740 commit 99b377d
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 2 deletions.
2 changes: 2 additions & 0 deletions 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.
File renamed without changes.
12 changes: 12 additions & 0 deletions 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
}
4 changes: 2 additions & 2 deletions link_windows_amd64.go
Expand Up @@ -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() {
Expand Down
32 changes: 32 additions & 0 deletions static.manifest
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="CompanyName.ProductName.YourApplication"
type="win32"
/>
<description>Your application description here.</description>
<!-- we DO need comctl6 in the static case -->
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!--The ID below indicates application support for Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!--The ID below indicates application support for Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</assembly>

3 changes: 3 additions & 0 deletions static.rc
@@ -0,0 +1,3 @@
/* 5 june 2016 */
#pragma code_page(65001)
1 24 "static.manifest"
Binary file added static_windows_386.o
Binary file not shown.
Binary file added static_windows_amd64.o
Binary file not shown.

0 comments on commit 99b377d

Please sign in to comment.