Import("env")

env["SWIFTOOLS_FLAGS"] = {
		"LIBPATH": [Dir(".")],
		"LIBS": ["SwifTools"]
	}

myenv = env.Clone()
myenv.MergeFlags(myenv["BOOST_FLAGS"])

sources = [
		"Idle/IdleDetector.cpp",
		"Idle/ActualIdleDetector.cpp",
		"Idle/IdleQuerier.cpp",
		"Idle/PlatformIdleQuerier.cpp",
		"Linkify.cpp",
	]

if myenv["PLATFORM"] == "win32" :
	sources += ["Idle/WindowsIdleQuerier.cpp"]
elif myenv["PLATFORM"] == "darwin" :
	sources += ["Idle/MacOSXIdleQuerier.cpp"]
elif myenv["HAVE_XSS"] :
	myenv.Append(CPPDEFINES = ["HAVE_XSS"])
	sources += ["Idle/XSSIdleQuerier.cpp"]
else :
  sources += ["Idle/DummyIdleQuerier.cpp"]

myenv.StaticLibrary("SwifTools", sources)

SConscript(dirs = [
		"Idle/IdleQuerierTest",
		"Idle/UnitTest",
		"UnitTest"
	])