代码之家  ›  专栏  ›  技术社区  ›  Ivan Vučica

boost::python:在构建python扩展时向gcc传递自定义参数

  •  0
  • Ivan Vučica  · 技术社区  · 15 年前

    我需要通过 -Wl,-rpath,\$$ORIGIN/lib/ 到G++的链接器( reason )有没有办法在jamroot文件中传递这个参数?

    2 回复  |  直到 8 年前
        1
  •  2
  •   Community CDub    8 年前

    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扩展时,通过某种方式修改扩展别名boost.build链接,也许会有更好的方法,但我不知道该怎么做,甚至不知道是否可以做到。

        2
  •  0
  •   Funk Forty Niner    8 年前

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

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

    来源: RTM

    推荐文章