在 Windows 中构建 boost 的一个子集 [英] Building a subset of boost in windows

查看:22
本文介绍了在 Windows 中构建 boost 的一个子集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置 boost 的一个子集并使用 bjam 正确编译它,但是我没有得到我正在寻找的结果.我正在使用 boost 1.37.0 在 Windows 上工作.

I'm trying setup a subset of boost and get it properly compiled using bjam, however I'm not getting the result I'm looking for. I'm working on windows using boost 1.37.0.

假设我想要构建/安装库 smart_ptr 和文件系统.我特意选择了一个只有头文件的库和一个需要编译库的库.我希望将它们构建到一个目录结构中,类似于我使用 bjam 构建完整的 boost 安装(即不指定任何 --with-libraryX)但当然没有我不感兴趣的所有库时得到的目录结构.

Let's say I want the libraries smart_ptr and filesystem built/installed. I intentionally chose a header only library and one library needing to compile a library. I want them to be built into a directory structure similar to the one I would get if I built a complete boost installation with bjam (i.e not specifying any --with-libraryX) but of course without all the libraries I'm not interested in.

我的第一种方法是在 bjam 中使用 --with-filesystem --with-smart_ptr,但它似乎无法识别 smart_ptr(我尝试过 smartptr 和 smart-ptr 没有成功).我想这是因为它是一个只有头文件的库.

My first approach was to use the --with-filesystem --with-smart_ptr in bjam, however it seemed like it didn't recognize smart_ptr (I tried smartptr and smart-ptr without success). I guess this is because it's a header only library.

当我删除它并且只有 --with-filesystem 时,它似乎将所有库头文件复制到安装路径,并且只为文件系统构建库.库构建行为是我希望的行为,但是我在 boost 目录中安装了大量我不感兴趣的库的头文件.

When I removed it and only had --with-filesystem it seemed to copy ALL libraries header files to the install path and only build the libraries for filesystem. The library building behavior was the one I hoped for, but I got tons of header files for libraries I'm not interested in installed in my boost directory.

我的第二种方法是使用 bcp 复制相关项目.这确实奏效了,因为我只得到了我关心的项目(及其依赖项).但是,他们没有提供任何生成文件来构建复制的库.这意味着我需要为所有不只是头文件的库设置项目文件并手动构建它们.

My second approach was to use bcp to copy the relevant projects. This did work out in the sense that I only got the projects I cared about (and their dependencies). However they didn't provide any make files for building the libraries that was copied. This means I would need to setup projects files for all the libraries that are not header only and manually build them.

所以我的问题基本上是,有没有一种选择性地构建 boost 的方法,它只复制我感兴趣的库的头文件,并且只为我感兴趣的非头文件库构建库文件(以及 boost他们当然依赖的图书馆)?

So my question is basically, is there a way of selectively building boost that only copies the headers for the libraries I'm interested in and only building library files for the non header only libraries I'm interested in (and the boost libraries they are dependent on course)?

可能有大量基于手动/脚本的解决方案,但如果我可以只使用 bjam 运行某些东西,那对我来说会更有用,因为添加新库或升级到新的 boost 版本将非常简单.

There are probably tons of manual/scripting based solutions for this, but if I could get something running only using bjam would be way more useful for me since adding new libraries or upgrading to a new boost version would be very simple.

为第一种方法添加了完整的命令行:

Added the complete command line for the first approach:

bjam install --prefix=c:	empoostsmall 
   --build-dir=C:	empoostsmalltemp --layout=system 
   --with-filesystem variant=debug link=static threading=multi
   runtime-link=static

将 scoped_ptr 更改为 smart_ptr

Changed scoped_ptr to smart_ptr

推荐答案

已解决.

bcp 解决方案为项目提供了 make 文件,但是我需要将工具目录和 boost 目录的根目录复制到我复制所有库的位置以使事情运行起来.

The bcp solution had make files for the projects, however I needed to copy the tools directory and the root of the boost directory to the place I copied all my libs to get things up running.

这篇关于在 Windows 中构建 boost 的一个子集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆