summaryrefslogtreecommitdiffstats
blob: d383317617fba72dd52b6d5bce044e82a7e76e49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Import("env")

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

if env["SCONS_STAGE"] == "flags" :
	env["SWIFTOOLS_FLAGS"] = {
			"LIBPATH": [Dir(".")],
			"LIBS": ["SwifTools", "libhunspell-1.3"]
		}

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

if env["SCONS_STAGE"] == "build" :
	swiftools_env = env.Clone()
	swiftools_env.UseFlags(swiftools_env["SWIFTEN_FLAGS"])
	swiftools_env.UseFlags(swiftools_env["BOOST_FLAGS"])

	sources = [
			"Idle/IdleDetector.cpp",
			"Idle/ActualIdleDetector.cpp",
			"Idle/IdleQuerier.cpp",
			"Idle/PlatformIdleQuerier.cpp",
			"AutoUpdater/AutoUpdater.cpp",
			"AutoUpdater/PlatformAutoUpdaterFactory.cpp",
			"Linkify.cpp",
			"TabComplete.cpp",
			"LastLineTracker.cpp",
			"SpellCheckerFactory.cpp",
			"HunspellChecker.cpp",
			"SpellParser.cpp",
		]

	if swiftools_env.get("HAVE_SPARKLE", 0) :
		swiftools_env.MergeFlags(swiftools_env["SPARKLE_FLAGS"])
		swiftools_env.Append(CPPDEFINES = ["HAVE_SPARKLE"])
		sources += ["AutoUpdater/SparkleAutoUpdater.mm"]

	if swiftools_env["PLATFORM"] == "win32" :
		sources += ["Idle/WindowsIdleQuerier.cpp"]
	elif swiftools_env["PLATFORM"] == "darwin" and swiftools_env.get("HAVE_IOKIT", False) :
			swiftools_env.Append(CPPDEFINES = ["HAVE_IOKIT"])
			sources += ["Idle/MacOSXIdleQuerier.cpp"]
	elif swiftools_env["HAVE_XSS"] :
		swiftools_env.Append(CPPDEFINES = ["HAVE_XSS"])
		sources += ["Idle/XSSIdleQuerier.cpp"]

	swiftools_env.UseFlags(swiftools_env["BREAKPAD_FLAGS"])
	sources += ["CrashReporter.cpp"]
	
	swiftools_env["SWIFTOOLS_OBJECTS"] = []
	Export("swiftools_env")
	
	SConscript(dirs = [
			"Application",
			"Dock",
			"Notifier",
			"URIHandler",
			"Idle/IdleQuerierTest",
			"Idle/UnitTest",
			"Cocoa",
			"UnitTest"
		])

	swiftools_env.StaticLibrary("SwifTools", sources + swiftools_env["SWIFTOOLS_OBJECTS"])