是否有可能建立与铛和gcc支持提升? [英] Is it possible to build boost with clang and gcc support?

查看:137
本文介绍了是否有可能建立与铛和gcc支持提升?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个奇怪的问题,在这里我需要访问使用GCC和铿锵特定模块Boost库(这些程序进行交互。一个是gcc / g ++的排斥的,一个是铛独家)。有什么办法来构建提升,使两个模块调用的刺激时,访问相同的位置,但提升为能够促进海湾合作委员会或铛具体要求?

I am running into an odd problem, where I need to access boost libraries using both gcc and clang specific modules (these programs interact. One is gcc/g++ exclusive, and one is clang exclusive). Is there any way to build boost so that both modules access the same location when calling boost, but boost is able to facilitate gcc or clang specific requests?

推荐答案

这是可能的,但它是有问题的,如果你真的应该这样做。

It is possible, but it's questionable if you really should do that.

您将不得不选择要么使用的libc ++ 的libstdc ++ 有两种编译器。

You would have to choose either to use libc++ or libstdc++ with both compilers.

的libstdc ++ 绝对是铛以来最好的一个可以处理它完美,
GCC有几个解析的libc ++ 头的问题。

libstdc++ is definitely the better one since clang can deal with it flawlessly, gcc has problems parsing several libc++ headers.

这样的事情应该让铛使用gcc的的libstdc ++ Mac OS X上。

Something like this should make clang use gcc's libstdc++ on Mac OS X.

clang++ \
  -stdlib=libstdc++ \
  -nostdinc++ \
  -Qunused-arguments \
  -nodefaultlibs \
  <path to>x86_64-apple-darwin14/lib/libstdc++.a \
  <path to>x86_64-apple-darwin14/lib/libsupc++.a \
  <path to>lib/gcc/x86_64-apple-darwin14/5.2.0/libgcc.a \
  <path to>lib/gcc/x86_64-apple-darwin14/5.2.0/libgcc_eh.a \
  -lc \
  -Wl,-no_compact_unwind \
  -cxx-isystem <path to>x86_64-apple-darwin14/include/c++/5.2.0 \
  -cxx-isystem <path to>x86_64-apple-darwin14/include/c++/5.2.0/x86_64-apple-darwin14 \
  -mmacosx-version-min=10.7.0

我建议把这个包装脚本,然后通过 CXX =铛++ - ++的libstdc
升压构建脚本。

I recommend to put this in a wrapper script, then pass CXX=clang++-libstdc++ to the boost build script.

例如包装脚本:

#!/bin/sh

ls -l "$@"

裹LS。

这篇关于是否有可能建立与铛和gcc支持提升?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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