Make the midl builder put the targets in the target directory, rather than the source...
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 16 Jan 2004 02:56:17 +0000 (02:56 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Fri, 16 Jan 2004 02:56:17 +0000 (02:56 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@877 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Tool/midl.py
test/midl.py

index 45b9df3f8c4e18c6ebda7a9d320d44608a1c1d7c..553c05e03e894d61a66e80460708685bf424a189 100644 (file)
@@ -141,6 +141,9 @@ RELEASE 0.95 - XXX
 
   - Don't choke if a construction variable is a non-string value.
 
+  - Build Type Libraries in the target directory, not the source
+    directory.
+
 
 
 RELEASE 0.94 - Fri, 07 Nov 2003 05:29:48 -0600
index a3f816553e3dd0a7021d5428cdbc78d8cac06d84..fe424fcd0b333ed8d87f7b8ad19128b04336d8e4 100644 (file)
@@ -41,8 +41,8 @@ import SCons.Util
 
 def midl_emitter(target, source, env):
     """Produces a list of outputs from the MIDL compiler"""
-    base, ext = SCons.Util.splitext(str(source[0]))
-    tlb = base + '.tlb'
+    base, ext = SCons.Util.splitext(str(target[0]))
+    tlb = target[0]
     incl = base + '.h'
     interface = base + '_i.c'
     proxy = base + '_p.c'
index f2bb5d2a5c6483c24e1854f9c572b9e042250224..a0ff5dd1c3568cc2545fa40d2777bb9baf0448fc 100644 (file)
@@ -43,12 +43,14 @@ test.write('SConstruct',"""
 import os.path
 import os
 
-build = '#build'
 env = Environment(CCFLAGS = ' -nologo ', CPPPATH='${TARGET.dir}')
-Export('env','build')
+Export('env')
 
-BuildDir(build, 'src')
-SConscript(os.path.join(build,'SConscript'))
+BuildDir('build', 'src')
+SConscript(os.path.join('build','SConscript'))
+
+BuildDir('build2', 'src', duplicate=0)
+SConscript(os.path.join('build2','SConscript'))
 """)
 
 test.subdir('src','build')
@@ -56,7 +58,7 @@ test.subdir('src','build')
 test.write('src/SConscript',"""
 import os.path
 
-Import('env','build')
+Import('env')
 
 local = env.Copy(WIN32_INSERT_DEF = 1)
 
@@ -407,4 +409,36 @@ test.fail_test(os.path.exists(test.workpath(os.path.join('build','bar.dll'))))
 test.fail_test(os.path.exists(test.workpath(os.path.join('build','bar.lib'))))
 test.fail_test(os.path.exists(test.workpath(os.path.join('build','bar.exp'))))
 
+test.run(arguments=os.path.join('build2','bar.dll'))
+
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','BarPCH.pch'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','BarPCH.obj'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.tlb'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.h'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar_i.c'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar_p.c'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar_data.c'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','BarObject.obj'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.obj'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.res'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.dll'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.lib'))))
+test.fail_test(not os.path.exists(test.workpath(os.path.join('build2','bar.exp'))))
+
+test.run(arguments='-c .')
+
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','BarPCH.pch'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','BarPCH.obj'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.tlb'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.h'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar_i.c'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar_p.c'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar_data.c'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','BarObject.obj'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.obj'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.res'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.dll'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.lib'))))
+test.fail_test(os.path.exists(test.workpath(os.path.join('build2','bar.exp'))))
+
 test.pass_test()