Import("env")
import Version

################################################################################
# Flags
################################################################################

if env["SCONS_STAGE"] == "flags" :
	env["SWIFT_CONTROLLERS_FLAGS"] = {
			"LIBPATH": [Dir(".")],
			"LIBS": ["SwiftControllers"]
		}


################################################################################
# Build
################################################################################

if env["SCONS_STAGE"] == "build" :
	myenv = env.Clone()
	myenv.BuildVersion("BuildVersion.h", project = "swift")
	myenv.MergeFlags(env["BOOST_FLAGS"])
	myenv.StaticLibrary("SwiftControllers", [
			"Chat/ChatController.cpp",
			"Chat/ChatControllerBase.cpp",
			"Chat/ChatsManager.cpp",
			"Chat/MUCController.cpp",
			"Chat/MUCSearchController.cpp",
			"MainController.cpp",
			"NickResolver.cpp",
			"RosterController.cpp",
			"XMPPRosterController.cpp",
			"EventController.cpp",
			"EventWindowController.cpp",
			"SoundEventController.cpp",
			"SystemTrayController.cpp",
			"XMLConsoleController.cpp",
			"StatusTracker.cpp",
			"UIEvents/UIEvent.cpp",
			"UIInterfaces/XMLConsoleWidget.cpp",
			"UIInterfaces/ChatListWindow.cpp",
			"PreviousStatusStore.cpp",
		])

	env.Append(UNITTEST_SOURCES = [
			File("UnitTest/NickResolverTest.cpp"),
			File("UnitTest/RosterControllerTest.cpp"),
			File("UnitTest/XMPPRosterControllerTest.cpp"),
			File("UnitTest/PreviousStatusStoreTest.cpp"),
			File("Chat/UnitTest/ChatsManagerTest.cpp"),
			File("Chat/UnitTest/MUCControllerTest.cpp"),
			File("UnitTest/MockChatWindow.cpp"),
		])