こんにちは、waf (1.7.5) に完全に移行する前に、次の構造の単純なプロジェクトを作成しようとしました。
wafproject
├── application
│ ├── main.cpp
│ └── wscript
├── library1
│ ├── foo1.hpp
│ ├── foo2.hpp
│ └── wscript
└── wscript
これはルートwscript
です:
def options(opt) :
opt.load('compiler_cxx')
def configure(cnf) :
cnf.load('compiler_cxx')
def build(bld) :
bld.recurse('library1')
bld.recurse('application')
これは次のapplication
wscript
とおりです。
def build(bld) :
bld( features = 'cxx cxxprogram'
, target = 'application'
, source = 'main.cpp'
, use = ['library1']
)
これはlibrary1
wscript
def build(bld) :
bld( name = 'library1'
, inludes = '../../'
, export_inludes = '../../'
)
(注: fortarget
の代わりにを使用してみました。また、 の機能を有効にしようとしました。)name
library1
cxx cxxshlib
library1
これは次のmain.cpp
とおりです。
#include <wafproject/library1/foo1.hpp>
#include <wafproject/library1/foo2.hpp>
int main()
{
}
そして、これは私が得るエラーです:
Setting top to : /home/<path>/wafproject
Setting out to : /home/<path>/wafproject/build
Checking for 'g++' (c++ compiler) : /usr/bin/g++
'configure' finished successfully (0.038s)
Waf: Entering directory `/home/<path>/wafproject/build'
[1/3] cxxshlib: -> build/library1/liblibrary1.so
[2/3] cxx: application/main.cpp -> build/application/main.cpp.1.o
../application/main.cpp:1:40: fatal error: wafproject/library1/foo1.hpp: Directory or file does not exist.
compilation terminated.
Waf: Leaving directory `/home/<path>/wafproject/build'
Build failed
-> task in 'application' failed (exit status 1):
{task 139729350901264: cxx main.cpp -> main.cpp.1.o}
['/usr/bin/g++', '../application/main.cpp', '-c', '-o', 'application/main.cpp.1.o']
ヘッダーを含める方法を変更したくありませんが、そのためには、プロジェクトの設定方法を変更する必要があるようです。
ご意見をお寄せいただければ幸いです。ありがとうございます。
EDIT:解決しました、それは単なるタイプミスでした(inludes
代わりにincludes
andexport_inludes
の代わりにexport_includes
)。