代码之家  ›  专栏  ›  技术社区  ›  Imran

Nim编译器优化标志

  •  2
  • Imran  · 技术社区  · 7 年前

    假设我正在使用 nim c -d:release myprog.nim . 如何查看传递给的标志 gcc ,以及如何指定其他标志?例如,我想使用 -ffast-math .

    我试着在 /etc/nim.cfg ,但我更希望能直接看到 nim c 正在发射。

    1 回复  |  直到 7 年前
        1
  •  4
  •   bsinky    7 年前

    我想 --listCmd (来自 Compiler User Guide ,高级标志部分)将 显示 传递给C编译器的标志。

    为了直接将标志传递给C编译器,《Nim编译器用户指南》中有这样一句话:

    -t, --passC:OPTION  pass an option to the C compiler
    -l, --passL:OPTION  pass an option to the linker
    

    我自己也没试过,但看起来应该有用。