From 6838ea0d6e566050b49f8aff46bda85442945826 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Thu, 22 Apr 2010 21:31:32 +0200
Subject: Don't compile CppUnit if we're not testing.


diff --git a/3rdParty/CppUnit/SConscript b/3rdParty/CppUnit/SConscript
index 95109e1..bdcea88 100644
--- a/3rdParty/CppUnit/SConscript
+++ b/3rdParty/CppUnit/SConscript
@@ -1,55 +1,57 @@
 Import("env")
 
+if env["TEST"] :
+
 ################################################################################
 # Module flags
 ################################################################################
 
-if env["SCONS_STAGE"] == "flags" :
-	env["CPPUNIT_FLAGS"] = {
-			"CPPPATH": [env.Dir("src/include"), env.Dir(".")],
-			"LIBPATH": [env.Dir(".")],
-			"LIBS": ["CppUnit"]
-		}
+	if env["SCONS_STAGE"] == "flags" :
+		env["CPPUNIT_FLAGS"] = {
+				"CPPPATH": [env.Dir("src/include"), env.Dir(".")],
+				"LIBPATH": [env.Dir(".")],
+				"LIBS": ["CppUnit"]
+			}
 
 ################################################################################
 # Build
 ################################################################################
 
-if env["SCONS_STAGE"] == "build" :
-	myenv = env.Clone()
-	myenv.Append(CPPPATH = ["src/include", "."])
-	sources = [
-			"src/src/cppunit/TextTestRunner.cpp",
-			"src/src/cppunit/TextTestProgressListener.cpp",
-			"src/src/cppunit/BriefTestProgressListener.cpp",
-			"src/src/cppunit/TextOutputter.cpp",
-			"src/src/cppunit/XmlOutputter.cpp",
-			"src/src/cppunit/XmlElement.cpp",
-			"src/src/cppunit/XmlDocument.cpp",
-			"src/src/cppunit/StringTools.cpp",
-			"src/src/cppunit/DefaultProtector.cpp",
-			"src/src/cppunit/Protector.cpp",
-			"src/src/cppunit/ProtectorChain.cpp",
-			"src/src/cppunit/SynchronizedObject.cpp",
-			"src/src/cppunit/SourceLine.cpp",
-			"src/src/cppunit/TestRunner.cpp",
-			"src/src/cppunit/TestFactoryRegistry.cpp",
-			"src/src/cppunit/TestSuite.cpp",
-			"src/src/cppunit/TestSuiteBuilderContext.cpp",
-			"src/src/cppunit/TestResult.cpp",
-			"src/src/cppunit/TestResultCollector.cpp",
-			"src/src/cppunit/TestSuccessListener.cpp",
-			"src/src/cppunit/TestComposite.cpp",
-			"src/src/cppunit/TestCase.cpp",
-			"src/src/cppunit/TestFailure.cpp",
-			"src/src/cppunit/TestLeaf.cpp",
-			"src/src/cppunit/TestNamer.cpp",
-			"src/src/cppunit/Asserter.cpp",
-			"src/src/cppunit/TypeInfoHelper.cpp",
-			"src/src/cppunit/Exception.cpp",
-			"src/src/cppunit/Message.cpp",
-			"src/src/cppunit/AdditionalMessage.cpp",
-			"src/src/cppunit/Test.cpp",
-			"src/src/cppunit/TestPath.cpp"
-		]
-	myenv.StaticLibrary("CppUnit", sources)
+	if env["SCONS_STAGE"] == "build" :
+		myenv = env.Clone()
+		myenv.Append(CPPPATH = ["src/include", "."])
+		sources = [
+				"src/src/cppunit/TextTestRunner.cpp",
+				"src/src/cppunit/TextTestProgressListener.cpp",
+				"src/src/cppunit/BriefTestProgressListener.cpp",
+				"src/src/cppunit/TextOutputter.cpp",
+				"src/src/cppunit/XmlOutputter.cpp",
+				"src/src/cppunit/XmlElement.cpp",
+				"src/src/cppunit/XmlDocument.cpp",
+				"src/src/cppunit/StringTools.cpp",
+				"src/src/cppunit/DefaultProtector.cpp",
+				"src/src/cppunit/Protector.cpp",
+				"src/src/cppunit/ProtectorChain.cpp",
+				"src/src/cppunit/SynchronizedObject.cpp",
+				"src/src/cppunit/SourceLine.cpp",
+				"src/src/cppunit/TestRunner.cpp",
+				"src/src/cppunit/TestFactoryRegistry.cpp",
+				"src/src/cppunit/TestSuite.cpp",
+				"src/src/cppunit/TestSuiteBuilderContext.cpp",
+				"src/src/cppunit/TestResult.cpp",
+				"src/src/cppunit/TestResultCollector.cpp",
+				"src/src/cppunit/TestSuccessListener.cpp",
+				"src/src/cppunit/TestComposite.cpp",
+				"src/src/cppunit/TestCase.cpp",
+				"src/src/cppunit/TestFailure.cpp",
+				"src/src/cppunit/TestLeaf.cpp",
+				"src/src/cppunit/TestNamer.cpp",
+				"src/src/cppunit/Asserter.cpp",
+				"src/src/cppunit/TypeInfoHelper.cpp",
+				"src/src/cppunit/Exception.cpp",
+				"src/src/cppunit/Message.cpp",
+				"src/src/cppunit/AdditionalMessage.cpp",
+				"src/src/cppunit/Test.cpp",
+				"src/src/cppunit/TestPath.cpp"
+			]
+		myenv.StaticLibrary("CppUnit", sources)
diff --git a/Slimber/Qt/SConscript b/Slimber/Qt/SConscript
index b2b8320..c2e203c 100644
--- a/Slimber/Qt/SConscript
+++ b/Slimber/Qt/SConscript
@@ -6,7 +6,6 @@ myenv = env.Clone()
 
 myenv.MergeFlags(env["SLIMBER_FLAGS"])
 myenv.MergeFlags(env["SWIFTEN_FLAGS"])
-myenv.MergeFlags(env["CPPUNIT_FLAGS"])
 myenv.MergeFlags(env["LIBIDN_FLAGS"])
 myenv.MergeFlags(env["BOOST_FLAGS"])
 myenv.MergeFlags(env.get("LIBXML_FLAGS", ""))
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 151cc3a..af7dd68 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -27,7 +27,6 @@ if myenv["HAVE_XSS"] :
 if myenv["HAVE_SPARKLE"] :
   myenv.MergeFlags(env["SPARKLE_FLAGS"])
 myenv.MergeFlags(env["SWIFTEN_FLAGS"])
-myenv.MergeFlags(env["CPPUNIT_FLAGS"])
 myenv.MergeFlags(env["LIBIDN_FLAGS"])
 myenv.MergeFlags(env["BOOST_FLAGS"])
 myenv.MergeFlags(env["SQLITE_FLAGS"])
diff --git a/Swiften/Examples/ConnectivityTest/SConscript b/Swiften/Examples/ConnectivityTest/SConscript
index 7a943dc..55a0b36 100644
--- a/Swiften/Examples/ConnectivityTest/SConscript
+++ b/Swiften/Examples/ConnectivityTest/SConscript
@@ -2,7 +2,6 @@ Import("env")
 
 myenv = env.Clone()
 myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["CPPUNIT_FLAGS"])
 myenv.MergeFlags(myenv["LIBIDN_FLAGS"])
 myenv.MergeFlags(myenv["BOOST_FLAGS"])
 myenv.MergeFlags(myenv["SQLITE_FLAGS"])
diff --git a/Swiften/Examples/SendMessage/SConscript b/Swiften/Examples/SendMessage/SConscript
index 0e0197e..c3f325e 100644
--- a/Swiften/Examples/SendMessage/SConscript
+++ b/Swiften/Examples/SendMessage/SConscript
@@ -2,7 +2,6 @@ Import("env")
 
 myenv = env.Clone()
 myenv.MergeFlags(myenv["SWIFTEN_FLAGS"])
-myenv.MergeFlags(myenv["CPPUNIT_FLAGS"])
 myenv.MergeFlags(myenv["LIBIDN_FLAGS"])
 myenv.MergeFlags(myenv["BOOST_FLAGS"])
 myenv.MergeFlags(myenv["SQLITE_FLAGS"])
-- 
cgit v0.10.2-6-g49f6