1

I am using boost-build to build my project, but I have added a library as a dependency that is built using GNU make. If I build this library manually, I can link it to my project in boost build using this simple Jamfile:

lib hts
  : 
  : <link>static <file>lib/lib.a
  :
  : <include>lib_headers 
;

Is there a way to tell boost-build to run make on the directory if the lib/lib.a is not present there?

4

1 回答 1

1

在 Boost 邮件列表的帮助下,我们提出了这个解决方案。首先,您创建一个使用 make 构建库的操作。然后你添加一个“make”目标来教 boost-build 如何使用你刚刚创建的动作来创建静态库。然后创建一个 boost-build 可以依赖的别名,并与 Jamfile 的其余部分很好地配合使用。

path-constant lib_dir : lib ;
actions external-make
{
  cd $(lib_dir) && make
}
make lib.a : : @external-make : <location>lib_dir ;
alias hts
  : lib.a
  : <link>static
  :
  : <include>lib_headers
;

在您的构建中,您可以使用“hts”作为该库的目标。

于 2014-03-30T22:44:09.817 回答