summaryrefslogtreecommitdiffstats
blob: 0b97289f4527465f1f9d68d61c6d2066378986d6 (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
Import("env")

if env["TEST"] :

    if env["PLATFORM"] == "win32" :
        cppflags = ["/I" + Dir("src/include").abspath]
    elif env["PLATFORM"] == "sunos" :
        cppflags = [("-I" + Dir("src/include").abspath)]
    else :
        cppflags = [("-isystem", Dir("src/include").abspath)]

################################################################################
# Module flags
################################################################################

    if env["SCONS_STAGE"] == "flags" :
        env["CPPUNIT_FLAGS"] = {
                "CPPPATH": [env.Dir(".")],
                "CPPFLAGS": cppflags,
                "LIBPATH": [env.Dir(".")],
                "LIBS": ["Swiften_CppUnit"]
            }

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

    if env["SCONS_STAGE"] == "build" :
        myenv = env.Clone()
        myenv.Replace(CXXFLAGS = [flag for flag in env["CXXFLAGS"] if not flag.startswith("-W")])
        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("Swiften_CppUnit", sources)