我配置了以下卫星:
current_directory
|-<.cpp files>
|-<.h files>
|-SConstruct
|-SConscript
|-bin
|-<empty>
我要构建我的源文件,并将可执行文件及对象文件放入 bin
目录。
这是我在我的 SCcompruilct
文件里有的内容 :
SConscript( SConscript , variant_dir= bin , duplicate=0)
在 SConsript
文件中,我有:
debug_environment.Program(target = SsaTest , src_files, LIBS=libraries, LIBPATH=libraries_path)
当我使用 scons
命令构建时,我在 SsaTest
目录中(按要求)获得可执行的 SsaTest
,但对象文件仍留在当前目录中。
如何将 .o
文件建在 >bin
目录中?
非常感谢。
EDIT: 完整 Scontruit
file (为 xxxx
s原谅我)
import os
# This is correctly Exported()
Import( debug_flags )
# Paths to header files
headers_paths = [ #/../../xxx/include/ ,
#/../../../xxx/include/ ,
#/../../xxx/include/ ,
#/../../xxx/include/ ,
#/../../xxx/include/ ]
# Path to source files
src_folder = #./
# Source files list
src_files = [ xxx.cpp ,
xxx.cpp ,
xxx.cpp ,
xxx.cpp ,
xxx.cpp ]
# Prepend the relative path to each source file name
src_files = [src_folder + filename for filename in src_files]
libraries = [ xxx , xxx , xxx , xxx , xxx , xxx , xxx , xxx ]
libraries_path = [ #/../../xxx/lib ,
#/../../../xxx/bin ,
#/../lib ,
#/../../xxx/lib ,
#/../../xxx/lib ,
#/../../xxx/lib ]
# Debug environment
debug_environment = Environment(CC = g++ , CCFLAGS=debug_flags, ENV = os.environ, CPPPATH=headers_paths);
# Executable build command
debug_environment.Program(target = SsaTest , src_files, LIBS=libraries, LIBPATH=libraries_path)