【问题标题】:How can I give extra compiler parameters with SIP 5?如何使用 SIP 5 提供额外的编译器参数?
【发布时间】:2020-02-23 01:31:30
【问题描述】:

尝试使用 SIP 5 构建 Python 绑定。但我不知道如何将参数传递给编译器。

在 SIP 4.x 中,configure.py 中的编译器设置可能有额外的选项

makefile = sipconfig.SIPModuleMakefile(config, build_file)

makefile.extra_libs = ["foo"]
makefile.extra_cxxflags = ["-std=c++17"]

对于 SIP 5,我不知道如何才能做到这一点,因为 configure.py 不再是其中的一部分。

我已经查看并搜索了文档,但无济于事。

现在我收到类似的警告 warning: scoped enumerations are a C++11 extension [-Wc++11-extensions]

我希望将正确的参数传递给编译器。

【问题讨论】:

    标签: python-3.x python-sip


    【解决方案1】:

    我相信这是通过 Bindings 部分下的 pyproject.toml 文件完成的。

    https://www.riverbankcomputing.com/static/Docs/sip/pyproject_toml.html#bindings-sections

    有参数extra-compile-argslibraries 可以做你想做的事。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多