次の SCons 構成があります。
current_directory
|-<.cpp files>
|-<.h files>
|-SConstruct
|-SConscript
|-bin
|-<empty>
bin
ソース ファイルをビルドし、実行可能ファイルとオブジェクト ファイルをディレクトリに配置したいと考えています。
これは私のSConstruct
ファイルにあるものです:
SConscript('SConscript', variant_dir='bin', duplicate=0)
私が持っているSConsript
ファイルにいる間:
debug_environment.Program(target = 'SsaTest', src_files, LIBS=libraries, LIBPATH=libraries_path)
scons
コマンドを使用してビルドすると、(必要に応じSsaTest
て) ディレクトリに実行可能bin
ファイルが作成されますが、オブジェクト ファイルは現在のディレクトリに残ります。
.o
ファイルをbin
ディレクトリにも構築するにはどうすればよいですか?
どうもありがとう。
編集: 完全なSConscript
ファイル(s を許してくださいxxx
)
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)