File: SConstruct

package info (click to toggle)
0ad 0.0.26-2~bpo11%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye-backports
  • size: 122,848 kB
  • sloc: cpp: 261,824; ansic: 198,392; javascript: 19,067; python: 14,557; sh: 7,624; perl: 4,072; xml: 849; makefile: 740; java: 533; ruby: 229; php: 190; pascal: 30; sql: 21; tcl: 4
file content (35 lines) | stat: -rw-r--r-- 1,000 bytes parent folder | download | duplicates (13)
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
# What I want to do is the following:
# I have my class files ending with .cc and
# the main file ending with .cpp. This way it
# very easy to do the following line just to
# have all sources in that variable

import os

mySrc = Glob("*.cc")
myFlags = ['-I.']

myEnv = Environment( ENV = os.environ, tools = ['default', \
    'cxxtest'], toolpath=['../../'])

# Here is the first problem I corrected:
# Flags won't be correctly recognized by cxxtest
myEnv.Replace(CXXFLAGS = myFlags)


# Then I want to convert those sources to objects

myObjs = myEnv.Object(mySrc)

# Having the objects I can create my program
# this way:

myEnv.Program('hello', ['main.cpp'] + myObjs)

# Now I want to do the same thing with the tests
# target
# With the non corrected version you'll get 2 errors:
# The CXXFLAGS are not set correctly
# It won't even accept this construction, which as you see
# works perfectly with Program (and CxxTest should work like it)
myEnv.CxxTest('helloTest', ['hellotest.t.h'] + myObjs)