【问题标题】:Boost::Python: Passing custom arguments to gcc when building python-extensionBoost::Python:在构建 python-extension 时将自定义参数传递给 gcc
【发布时间】:2010-02-02 10:50:14
【问题描述】:

我需要将 -Wl,-rpath,\$$ORIGIN/lib/ 传递给 g++ 的链接器 (reason)。有没有办法在 Jamroot 文件中传递这个参数?

【问题讨论】:

    标签: linux boost boost-python boost-build bjam


    【解决方案1】:

    Ivan Vucica already described how to do it by modifying the toolset。另一种选择是将其添加到项目的属性中。在 Jamroot 的顶部,添加以下规则(或修改预先存在的 project 规则)。

    project
      : requirements
          <toolset>gcc:<linkflags>"-Wl,-rpath,\\$ORIGIN/lib"
      ;
    

    这只会影响这个项目上的 gcc,即使当前的 using gcc ; 命令是从 Jamroot 外部调用的(就像在 Ubuntu 的默认配置中一样)。

    在调用 python-extension 时以某种方式修改 Boost.Build 链接的 python-for-extensions 别名可能会有更好的方法,但我不知道该怎么做,或者即使可以做到。

    【讨论】:

      【解决方案2】:

      要修改链接标志,请使用大约:

      using gcc : : : <linkflags>"-Wl,-rpath,\\$ORIGIN/lb" ;
      

      来源:RTM

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-07-08
        • 1970-01-01
        • 1970-01-01
        • 2014-02-22
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多