简体   繁体   English

通过Boost使用多个STLport配置

[英]Using multiple STLport configurations with Boost

I use Boost (1.54.0, bjam 2011.12.1. OS=NT) with STLport (5.2.1) on a Windows CE development project. 我在Windows CE开发项目上使用带有STLport (5.2.1)的Boost (1.54.0,bjam 2011.12.1。OS = NT)。 I first started with a single Windows CE platform SDK and all went mostly fine. 我首先从一个Windows CE平台SDK开始,然后一切正常。 But now I need to support several Windows CE platform SDKs, each with its own system headers and compilation flags. 但是现在我需要支持多个Windows CE平台SDK,每个SDK都有自己的系统头和编译标志。

First, I've build STLport for each of these platforms (say PLATFORM1 and PLATFORM2), and put the STLport libraries to, say, c:\\lib\\STLport-5.2.1\\lib\\PLATFORM1 and c:\\lib\\STLport-5.2.1\\lib\\PLATFORM2 . 首先,我为每个平台(例如PLATFORM1和PLATFORM2)构建了STLport,然后将STLport库放入c:\\lib\\STLport-5.2.1\\lib\\PLATFORM1c:\\lib\\STLport-5.2.1\\lib\\PLATFORM2

Then, in the user-config.jam I have: 然后,在user-config.jam我有:

using stlport : 5.2.1~PLATFORM1 : c:/lib/STLport-5.2.1/stlport : c:/lib/STLport-5.2.1/lib/PLATFORM1 ;
using stlport : 5.2.1~PLATFORM2 : c:/lib/STLport-5.2.1/stlport : c:/lib/STLport-5.2.1/lib/PLATFORM2 ;

Then, for PLATFORM1 I build Boost libraries by running bjam.exe with the stdlib=stlport-5.2.1~PLATFORM1 flag, while building for PLATFORM2 uses stdlib=stlport-5.2.1~PLATFORM2 . 然后,对于PLATFORM1,我通过运行带有stdlib=stlport-5.2.1~PLATFORM1标志的bjam.exe来构建Boost库,而对于PLATFORM2的构建则使用stdlib=stlport-5.2.1~PLATFORM2

But wrong STLport library path is used by bjam for PLATFORM2. 但是bjam为PLATFORM2使用了错误的STLport库路径。 Eg, running bjam with the -n flag shows the following linking commands for the platforms (note the wrong LIBPATH parameter in the second call): 例如,使用-n标志运行bjam将显示以下针对平台的链接命令(请注意第二个调用中的LIBPATH参数错误):

link.exe ... /out:"building\...\stdlib-stlport-5.2.1~PLATOFRM1\threading-multi\boost_xxx.dll" ... /LIBPATH:"c:\lib\STLport-5.2.1\lib\PLATFORM1"
link.exe ... /out:"building\...\stdlib-stlport-5.2.1~PLATOFRM2\threading-multi\boost_xxx.dll" ... /LIBPATH:"c:\lib\STLport-5.2.1\lib\PLATFORM1"

Basically, it always uses the first using stlport directive from the user-config.jam, no matter what version I'm passing to the stdlib parameter . 基本上, 无论我将哪个版本传递给stdlib参数它始终使用user-config.jam中的第一个using stlport指令 Am I doing something wrong? 难道我做错了什么? What is the correct way to setup environment to be able to build Boost with different STLport binaries? 设置环境以使用不同的STLport二进制文件构建Boost的正确方法是什么?

I solved the problem by using a special variable to define STLport libraries location. 我通过使用特殊变量定义STLport库位置来解决此问题。 Basically, I did it the following way. 基本上,我是通过以下方式完成的。

In the user-config.jam I changed all my STLport toolset initializations to a single one: user-config.jam我将所有STLport工具集初始化更改为一个:

using stlport : 5.2.1 : c:/lib/STLport-5.2.1/stlport : c:/lib/STLport-5.2.1/lib/ $(STLPORTLIBSUBDIR) ; 使用stlport:5.2.1:c:/lib/STLport-5.2.1/stlport:c:/lib/STLport-5.2.1/lib/ $(STLPORTLIBSUBDIR) ;

Also, to peek the variable, I added the following line somewhere before the using directive: 另外,为了窥视该变量,我在using指令之前的某处添加了以下行:

local STLPORTLIBSUBDIR = [ modules.peek : STLPORTLIBSUBDIR ] ; 本地STLPORTLIBSUBDIR = [modules.peek:STLPORTLIBSUBDIR];

And then, to build Boost libraries for PLATFORM1, I need to pass bjam the following parameters: 然后,要为PLATFORM1构建Boost库,我需要传递bjam以下参数:

stdlib=stlport-5.2.1 and -sSTLPORTLIBSUBDIR=PLATFORM1 stdlib=stlport-5.2.1-sSTLPORTLIBSUBDIR=PLATFORM1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM