From 5f5f4f6c2adde30e1f15ff46b209c7e4312630f8 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 19 May 2014 23:53:10 -0400 Subject: Set up the Mac OS X build to always target Mac OS X 10.6 regardless of the host system; this is what we want and by default building on 10.8 produces binaries which won't run on 10.6. This isn't working yet, though: one enum in NSApplication.h becomes empty on 10.6... --- objc_darwin.h | 3 +++ uitask_darwin.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/objc_darwin.h b/objc_darwin.h index 9bff48f..4b084ee 100644 --- a/objc_darwin.h +++ b/objc_darwin.h @@ -5,6 +5,9 @@ #ifndef __GO_UI_OBJC_DARWIN_H__ #define __GO_UI_OBJC_DARWIN_H__ +#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6 +#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_6 + /* the Objective-C runtime headers, for id */ #include #include diff --git a/uitask_darwin.go b/uitask_darwin.go index f80d8b7..dce9479 100644 --- a/uitask_darwin.go +++ b/uitask_darwin.go @@ -8,7 +8,9 @@ import ( "unsafe" ) -// #cgo LDFLAGS: -lobjc -framework Foundation -framework AppKit +// #cgo CFLAGS: -mmacosx-version-min=10.6 -DMACOSX_DEPLOYMENT_TARGET=10.6 +// #cgo LDFLAGS: -mmacosx-version-min=10.6 -lobjc -framework Foundation -framework AppKit +// /* application compatibilty stuff via https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html, http://www.cocoawithlove.com/2009/09/building-for-earlier-os-versions-in.html, http://opensource.apple.com/source/xnu/xnu-2422.1.72/EXTERNAL_HEADERS/AvailabilityMacros.h (via http://stackoverflow.com/questions/20485797/what-macro-to-use-to-identify-mavericks-osx-10-9-in-c-c-code), and Beelsebob and LookyLuke_ICBM on irc.freenode.net/#macdev */ // #include "objc_darwin.h" import "C" -- cgit v1.2.3