From b6374b7ae064e689924a88b398ca3eb9ed0a379e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Thu, 13 Aug 2009 12:04:58 +0200 Subject: Add Nib build tool. diff --git a/BuildTools/SCons/Tools/Nib.py b/BuildTools/SCons/Tools/Nib.py new file mode 100644 index 0000000..ccfd884 --- /dev/null +++ b/BuildTools/SCons/Tools/Nib.py @@ -0,0 +1,12 @@ +import SCons.Util + +def generate(env) : + env["IBTOOL"] = "ibtool" + env["BUILDERS"]["Nib"] = SCons.Builder.Builder( + action = SCons.Action.Action("$IBTOOL --errors --warnings --notices --output-format human-readable-text --compile $TARGET $SOURCE", cmdstr = "$NIBCOMSTR"), + suffix = ".nib", + src_suffix = ".xib", + single_source = True) + +def exists(env) : + return env["PLATFORM"] == "darwin" diff --git a/SConstruct b/SConstruct index 3d8df43..ab9cf5e 100644 --- a/SConstruct +++ b/SConstruct @@ -25,9 +25,15 @@ vars.Add(PathVariable("qt", "Qt location", "", PathVariable.PathAccept)) ################################################################################ env = Environment(CPPPATH = "#", ENV = {'PATH' : os.environ['PATH']}, variables = vars) + Help(vars.GenerateHelpText(env)) + env.Alias("dist", ["."]) +# Default custom tools +if env["PLATFORM"] == "darwin" : + env.Tool("Nib", toolpath = ["#/BuildTools/SCons/Tools"]) + # Default compiler flags if env["optimize"] : env.Append(CCFLAGS = "-O2") @@ -109,6 +115,7 @@ if int(ARGUMENTS.get("V", 0)) == 0: env["GENCOMSTR"] = " \033[0;34;140mGEN\033[0m $TARGET" env["RCCOMSTR"] = " \033[0;34;140mRC\033[0m $TARGET" env["BUNDLECOMSTR"] = " \033[0;34;140mBUNDLE\033[0m $TARGET" + env["NIBCOMSTR"] = " \033[0;34;140mNIB\033[0m $TARGET" #Progress( " \033[0;35;140mDEP\033[0m $TARGET\n") else : env["CCCOMSTR"] = " CC $TARGET" @@ -123,6 +130,7 @@ if int(ARGUMENTS.get("V", 0)) == 0: env["GENCOMSTR"] = " GEN $TARGET" env["RCCOMSTR"] = " RC $TARGET" env["BUNDLECOMSTR"] = " BUNDLE $TARGET" + env["NIBCOMSTR"] = " NIB $TARGET" #Progress(' DEP $TARGET\n') if env["PLATFORM"] == "win32" : diff --git a/Slimber/Cocoa/SConscript b/Slimber/Cocoa/SConscript new file mode 100644 index 0000000..3e04273 --- /dev/null +++ b/Slimber/Cocoa/SConscript @@ -0,0 +1,17 @@ +Import("env") + +myenv = env.Clone() +myenv.MergeFlags(env["SLIMBER_FLAGS"]) +myenv.MergeFlags(env["SWIFTEN_FLAGS"]) +myenv.MergeFlags(env["LIBIDN_FLAGS"]) +myenv.MergeFlags(env["BOOST_FLAGS"]) +myenv.Append(FRAMEWORKS = "Cocoa") + +myenv.Program("Slimber", [ + "main.mm", + "CocoaController.mm", + "CocoaMenulet.mm", + "CocoaAction.mm" + ]) + +myenv.Nib("MainMenu") diff --git a/Swiften/SConscript b/Swiften/SConscript index 60f2fbc..1c2c8cc 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -38,6 +38,8 @@ sources = [ "EventLoop/EventOwner.cpp", "EventLoop/MainEventLoop.cpp", "EventLoop/SimpleEventLoop.cpp", + "EventLoop/Cocoa/CocoaEventLoop.mm", + "EventLoop/Cocoa/CocoaEvent.mm", "History/HistoryManager.cpp", "History/SQLiteHistoryManager.cpp", "JID/JID.cpp", -- cgit v0.10.2-6-g49f6