有一些我不明白。請參閱以下SConscript:SCons:需要一個解釋爲什麼安裝不與scons -u電話
Import('common_env')
import os
#Grab a copy of the top environment (the one sent by the SConstruct file)
common_env = common_env.Clone()
#Because this component is compiled in both win32 and win64.
if (common_env['ENV']['CONFIG'] == "win32") or (common_env['ENV']['CONFIG'] == "win64"):
#Grabs the library name, the name should look like libpath_of_current_component-(debug/opt)
libName = common_env.libName()
common_env.USE_BOOST()
#Grab all the sources in current dir.
sources = Glob('*.cpp')
#Creates the library
myLib = common_env.Library(libName, sources)
#Install (copy) the library in LINK/lib/winX
common_env.Install('#/LINK/lib/' + common_env['ENV']['CONFIG'], myLib)
如果這個腳本是從他的子文件夾中調用,我有以下的輸出:
scons: Entering directory `C:\svn\products\faa_mx\scons-test-speed3'
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64
cl /Fobuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocol.obj /c sr\speech\ASRNetworkLayer\ThinProtocol\ThinProtocol.cpp /TP /nologo -Od -D_DEBUG -RTC1 -MDd -Z7 -DBOOST_FILESYSTEM_VERSION=2 -DWIN32 -D_WIN32 -DWINDOWS -D_MBCS -DNOMINMAX -D_MSC_VER=1600 -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS -W3 -nologo -GS -GR -EHa -wd4290 -wd4996 -wd4995 -TP -DBOOST_FILESYSTEM_VERSION=2 /Iinterface\asom\api /Ifwk\simulation_fwk\utils /ILINK\include /Ibuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64 /Isr\speech\ASRNetworkLayer\ThinProtocol /IC:\svn\3rdParty\3rdPartyPackages\boost-1.47.0_vs2010_x64\include /Z7
ThinProtocol.cpp
cl /Fobuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocolMessageDefinitions.obj /c sr\speech\ASRNetworkLayer\ThinProtocol\ThinProtocolMessageDefinitions.cpp /TP /nologo -Od -D_DEBUG -RTC1 -MDd -Z7 -DBOOST_FILESYSTEM_VERSION=2 -DWIN32 -D_WIN32 -DWINDOWS -D_MBCS -DNOMINMAX -D_MSC_VER=1600 -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS -W3 -nologo -GS -GR -EHa -wd4290 -wd4996 -wd4995 -TP -DBOOST_FILESYSTEM_VERSION=2 /Iinterface\asom\api /Ifwk\simulation_fwk\utils /ILINK\include /Ibuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64 /Isr\speech\ASRNetworkLayer\ThinProtocol /IC:\svn\3rdParty\3rdPartyPackages\boost-1.47.0_vs2010_x64\include /Z7
ThinProtocolMessageDefinitions.cpp
cl /Fobuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocolMessaging.obj /c sr\speech\ASRNetworkLayer\ThinProtocol\ThinProtocolMessaging.cpp /TP /nologo -Od -D_DEBUG -RTC1 -MDd -Z7 -DBOOST_FILESYSTEM_VERSION=2 -DWIN32 -D_WIN32 -DWINDOWS -D_MBCS -DNOMINMAX -D_MSC_VER=1600 -D_WIN32_WINNT=0x0501 -D_CRT_SECURE_NO_WARNINGS -W3 -nologo -GS -GR -EHa -wd4290 -wd4996 -wd4995 -TP -DBOOST_FILESYSTEM_VERSION=2 /Iinterface\asom\api /Ifwk\simulation_fwk\utils /ILINK\include /Ibuild\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64 /Isr\speech\ASRNetworkLayer\ThinProtocol /IC:\svn\3rdParty\3rdPartyPackages\boost-1.47.0_vs2010_x64\include /Z7
ThinProtocolMessaging.cpp
lib /nologo /OUT:build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\win64\libsr_speech_ASRNetworkLayer_ThinProtocol-debug.lib build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocol.obj build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocolMessageDefinitions.obj build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\ThinProtocolMessaging.obj
scons: `sr\speech\ASRNetworkLayer\ThinProtocol' is up to date.
scons: done building targets.
正如你所看到的,Install
沒有被scons的電話都沒有。
如果不是從一個子文件夾我打電話scons
從根調用scons -u
的話,我有這樣的:
Install file: "build\debug\sr\speech\ASRNetworkLayer\ThinProtocol\win64\libsr_speech_ASRNetworkLayer_ThinProtocol-debug.lib" as "LINK\lib\win64\libsr_speech_ASRNetworkLayer_ThinProtocol-debug.lib"
我的問題是:爲什麼這種差異?是否因爲scons構建系統,在scons -u
的情況下,知道沒有人需要.lib,因此Install
未被調用?
Thx!