Skip to content

Commit

Permalink
Build windows/amd64 library based on version 1.4.0-1
Browse files Browse the repository at this point in the history
pwiecz committed Nov 18, 2024
1 parent b82739c commit a9a3e04
Showing 186 changed files with 40,329 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cgo_windows_amd64.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// go:build windows && amd64
//go:build windows && amd64

package fltk

// #cgo windows,amd64 CXXFLAGS: -std=c++11
// #cgo windows,amd64 CPPFLAGS: -I${SRCDIR}/lib/windows/amd64 -I${SRCDIR}/include -I${SRCDIR}/include/FL/images -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
// #cgo windows,amd64 CPPFLAGS: -I${SRCDIR}/include/windows/amd64 -I${SRCDIR}/include/windows/amd64/FL/images -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
// #cgo windows,amd64 LDFLAGS: -mwindows ${SRCDIR}/lib/windows/amd64/libfltk_images.a ${SRCDIR}/lib/windows/amd64/libfltk_jpeg.a ${SRCDIR}/lib/windows/amd64/libfltk_png.a ${SRCDIR}/lib/windows/amd64/libfltk_z.a ${SRCDIR}/lib/windows/amd64/libfltk_gl.a -lglu32 -lopengl32 ${SRCDIR}/lib/windows/amd64/libfltk_forms.a ${SRCDIR}/lib/windows/amd64/libfltk.a -lgdiplus -lole32 -luuid -lcomctl32 -lws2_32
import "C"
7 changes: 4 additions & 3 deletions fltk-build.go
Original file line number Diff line number Diff line change
@@ -244,11 +244,12 @@ func main() {

} else {
// Switching to slashes in paths in cgo directives as backslashes are causing problems when being passed to gcc.
libdir := filepath.ToSlash(libDir)
libDirWithSlashes := filepath.ToSlash(libDir)
includeDirWithSlashes := filepath.ToSlash(includeDir)
// Hardcoding contents of cgo directive for windows,
// as we cannot extract it from fltk-config if we're not using a UNIX shell.
fmt.Fprintf(cgoFile, "// #cgo %s,%s CPPFLAGS: -I${SRCDIR}/%s -I${SRCDIR}/%s/FL/images -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64\n", runtime.GOOS, runtime.GOARCH, includeDir, includeDir)
fmt.Fprintf(cgoFile, "// #cgo %s,%s LDFLAGS: -mwindows ${SRCDIR}/%s/libfltk_images.a ${SRCDIR}/%s/libfltk_jpeg.a ${SRCDIR}/%s/libfltk_png.a ${SRCDIR}/%s/libfltk_z.a ${SRCDIR}/%s/libfltk_gl.a -lglu32 -lopengl32 ${SRCDIR}/%s/libfltk_forms.a ${SRCDIR}/%s/libfltk.a -lgdiplus -lole32 -luuid -lcomctl32 -lws2_32\n", runtime.GOOS, runtime.GOARCH, libdir, libdir, libdir, libdir, libdir, libdir, libdir)
fmt.Fprintf(cgoFile, "// #cgo %s,%s CPPFLAGS: -I${SRCDIR}/%s -I${SRCDIR}/%s/FL/images -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64\n", runtime.GOOS, runtime.GOARCH, includeDirWithSlashes, includeDirWithSlashes)
fmt.Fprintf(cgoFile, "// #cgo %s,%s LDFLAGS: -mwindows ${SRCDIR}/%s/libfltk_images.a ${SRCDIR}/%s/libfltk_jpeg.a ${SRCDIR}/%s/libfltk_png.a ${SRCDIR}/%s/libfltk_z.a ${SRCDIR}/%s/libfltk_gl.a -lglu32 -lopengl32 ${SRCDIR}/%s/libfltk_forms.a ${SRCDIR}/%s/libfltk.a -lgdiplus -lole32 -luuid -lcomctl32 -lws2_32\n", runtime.GOOS, runtime.GOARCH, libDirWithSlashes, libDirWithSlashes, libDirWithSlashes, libDirWithSlashes, libDirWithSlashes, libDirWithSlashes, libDirWithSlashes)
}
fmt.Fprintln(cgoFile, "import \"C\"")

Loading

0 comments on commit a9a3e04

Please sign in to comment.