From 5fa4903a7c1c7a7733afdd1d6c4c5dcccec97b19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Fri, 20 Aug 2010 19:10:48 +0200
Subject: Fix Slimber build.


diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index abe8860..c4f6c88 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -70,6 +70,9 @@ if env["max_jobs"] :
 # Default compiler flags
 env["CCFLAGS"] = env.get("ccflags", [])
 env["LINKFLAGS"] = env.get("linkflags", [])
+# This isn't a real flag (yet) AFAIK. Be sure to append it to the CXXFLAGS
+# where you need it
+env["OBJCCFLAGS"] = []
 if env["optimize"] :
 	env.Append(CCFLAGS = "-O2")
 	if env["PLATFORM"] == "win32" :
@@ -174,6 +177,7 @@ if target in ["iphone-device", "iphone-simulator", "xcode"] :
 	# Set the build flags
 	env["CC"] = "$XCODE_PLATFORM_DEVELOPER_BIN_DIR/gcc"
 	env["CXX"] = "$XCODE_PLATFORM_DEVELOPER_BIN_DIR/g++"
+	env["OBJCCFLAGS"] = ["-fobjc-abi-version=2", "-fobjc-legacy-dispatch"]
 	env["LD"] = env["CC"]
 	env.Append(CCFLAGS = env["XCODE_ARCH_FLAGS"])
 	env.Append(LINKFLAGS = env["XCODE_ARCH_FLAGS"])
diff --git a/Slimber/Cocoa/SConscript b/Slimber/Cocoa/SConscript
index a354bc8..6594b9f 100644
--- a/Slimber/Cocoa/SConscript
+++ b/Slimber/Cocoa/SConscript
@@ -7,6 +7,7 @@ myenv.MergeFlags(env["LIBIDN_FLAGS"])
 myenv.MergeFlags(env["BOOST_FLAGS"])
 myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))
 myenv.MergeFlags(env.get("EXPAT_FLAGS", ""))
+myenv.Append(CXXFLAGS = myenv["OBJCCFLAGS"])
 myenv.Append(FRAMEWORKS = "Cocoa")
 
 myenv.Program("Slimber", [
diff --git a/Swiften/EventLoop/SConscript b/Swiften/EventLoop/SConscript
index 990b91b..248d451 100644
--- a/Swiften/EventLoop/SConscript
+++ b/Swiften/EventLoop/SConscript
@@ -12,7 +12,7 @@ swiften_env.Append(SWIFTEN_OBJECTS = [objects])
 
 if swiften_env["PLATFORM"] == "darwin" :
 	myenv = swiften_env.Clone()
-	myenv.Append(CXXFLAGS = ["-fobjc-abi-version=2", "-fobjc-legacy-dispatch"])
+	myenv.Append(CXXFLAGS = myenv["OBJCCFLAGS"])
 	objects = myenv.StaticObject([
 			"Cocoa/CocoaEventLoop.mm",
 			"Cocoa/CocoaEvent.mm"
-- 
cgit v0.10.2-6-g49f6