summaryrefslogtreecommitdiffstats
path: root/test/CCFLAGS.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2001-11-24 23:15:01 (GMT)
committerSteven Knight <knight@baldmt.com>2001-11-24 23:15:01 (GMT)
commit378373defaf150feb90cd54d13626516c6dbe1b4 (patch)
treefc9783004f1cae3c3558846d6f9a1c589e104a3e /test/CCFLAGS.py
parent139a0052dc0bff059dc9b8cf1739396304e7c129 (diff)
downloadSCons-378373defaf150feb90cd54d13626516c6dbe1b4.zip
SCons-378373defaf150feb90cd54d13626516c6dbe1b4.tar.gz
SCons-378373defaf150feb90cd54d13626516c6dbe1b4.tar.bz2
More NT portability fixes.
Diffstat (limited to 'test/CCFLAGS.py')
-rw-r--r--test/CCFLAGS.py36
1 files changed, 23 insertions, 13 deletions
diff --git a/test/CCFLAGS.py b/test/CCFLAGS.py
index 8b0e5a8..3c9e716 100644
--- a/test/CCFLAGS.py
+++ b/test/CCFLAGS.py
@@ -24,20 +24,30 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import sys
import TestSCons
+if sys.platform == 'win32':
+ _obj = '.obj'
+ fooflags = '/nologo -DFOO'
+ barflags = '/nologo -DBAR'
+else:
+ _obj = '.o'
+ fooflags = '-DFOO'
+ barflags = '-DBAR'
+
test = TestSCons.TestSCons()
test.write('SConstruct', """
-foo = Environment(CCFLAGS = '-DFOO')
-bar = Environment(CCFLAGS = '-DBAR')
-foo.Object(target = 'foo.o', source = 'prog.c')
-bar.Object(target = 'bar.o', source = 'prog.c')
-foo.Program(target = 'foo', source = 'foo.o')
-bar.Program(target = 'bar', source = 'bar.o')
-""")
+foo = Environment(CCFLAGS = '%s')
+bar = Environment(CCFLAGS = '%s')
+foo.Object(target = 'foo%s', source = 'prog.c')
+bar.Object(target = 'bar%s', source = 'prog.c')
+foo.Program(target = 'foo', source = 'foo%s')
+bar.Program(target = 'bar', source = 'bar%s')
+""" % (fooflags, barflags, _obj, _obj, _obj, _obj))
-test.write('prog.c', """
+test.write('prog.c', r"""
int
main(int argc, char *argv[])
{
@@ -60,11 +70,11 @@ test.run(program = test.workpath('bar'), stdout = "prog.c: BAR\n")
test.write('SConstruct', """
bar = Environment(CCFLAGS = '-DBAR')
-bar.Object(target = 'foo.o', source = 'prog.c')
-bar.Object(target = 'bar.o', source = 'prog.c')
-bar.Program(target = 'foo', source = 'foo.o')
-bar.Program(target = 'bar', source = 'bar.o')
-""")
+bar.Object(target = 'foo%s', source = 'prog.c')
+bar.Object(target = 'bar%s', source = 'prog.c')
+bar.Program(target = 'foo', source = 'foo%s')
+bar.Program(target = 'bar', source = 'bar%s')
+""" % (_obj, _obj, _obj, _obj))
test.run(arguments = '.')