summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-05-19 23:53:10 -0400
committerPietro Gagliardi <[email protected]>2014-05-19 23:53:10 -0400
commit5f5f4f6c2adde30e1f15ff46b209c7e4312630f8 (patch)
tree34e4868503033459c8bb55698dfd517f4c7cd98d
parent946e007e5d19001ec643ee8d5cbda9b7e1b1b58b (diff)
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...
-rw-r--r--objc_darwin.h3
-rw-r--r--uitask_darwin.go4
2 files changed, 6 insertions, 1 deletions
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 <objc/message.h>
#include <objc/objc.h>
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"