次の 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)