From: stevenknight Date: Fri, 16 Jan 2004 02:56:17 +0000 (+0000) Subject: Make the midl builder put the targets in the target directory, rather than the source... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7dcb6736f6a5b805d8cf45de48b7c4d5a3618bf8;p=scons.git Make the midl builder put the targets in the target directory, rather than the source directory. (Anthony Roach) git-svn-id: http://scons.tigris.org/svn/scons/trunk@877 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 45b9df3f..553c05e0 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -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 diff --git a/src/engine/SCons/Tool/midl.py b/src/engine/SCons/Tool/midl.py index a3f81655..fe424fcd 100644 --- a/src/engine/SCons/Tool/midl.py +++ b/src/engine/SCons/Tool/midl.py @@ -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' diff --git a/test/midl.py b/test/midl.py index f2bb5d2a..a0ff5dd1 100644 --- a/test/midl.py +++ b/test/midl.py @@ -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()