2017-03-02 5 views
0

CPPPATH値を無視するように表示されない:sconsのは、私がParseFlags経由CPPPATH変数を設定し

env = Environment() 
env["CXX"] = "clang++" 
d = env.ParseFlags("-I. -I../utl") 
print d 
env.StaticLibrary(target="myLib",source = source_files) 

Dの印刷がCPPPATHが正しいディレクトリに設定する例を示します

{'CPPFLAGS': [], 'FRAMEWORKPATH': [], 'LIBPATH': [], 'CXXFLAGS': [], 'LIBS': [], 'ASFLAGS': [], 'LINKFLAGS': [], 'RPATH': [], 'CPPDEFINES': [], 'FRAMEWORKS': [], 'CCFLAGS': [], 'CFLAGS': [], 'CPPPATH': ['.', '../utl']}

しかし、コンパイルの出力は何を持っています-Iオプション:

clang++ -o ABC_Exception.o -c ABC_Exception.cpp 

そして../utl

に含めるファイルを見つけることができません

./ABC_Exception.hpp:4:10: fatal error: 'Exception.hpp' file not found

答えて

2

ParseFlagsSCons documentationで説明したように、環境に変数を追加するMergeFlagsが続くべきです。

ParseFlags returns a dictionary containing the options distributed into their respective construction variables. Normally, this dictionary would be passed to MergeFlags to merge the options into a construction environment, but the dictionary can be edited if desired to provide additional functionality. (Note that if the flags are not going to be edited, calling MergeFlags with the options directly will avoid an additional step.)

この例では、ParseFlagsに渡された文字列でMergeFlagsを呼び出すことができます。

関連する問題