gpt4 book ai didi

nim-lang - 如何启用 --threads :on only for files using it?

转载 作者:行者123 更新时间:2023-12-05 03:16:18 26 4
gpt4 key购买 nike

在一个生成多个二进制文件的项目中,其中只有一部分正在导入需要传递 --threads:on 的库(在本例中为“threadpool”)对于编译器,将如何处理?

在我灵活的文件中我有类似的东西

srcDir = "src"
binDir = "bin"
namedBin = {
"program ": "program",
"prog_threads": "program-threads",
}.toTable()

目前我的 nim.cfg 文件中有 --threads:on,结果在所有使用线程支持编译的二进制文件中。我意识到这不是我需要的,因为它会在下游造成问题,而且我将需要一种方法来编译没有线程的程序和带有它的 prog_threads。

我正在使用“Makefile”作为解决方法,但我希望能够构建nimble build 的项目。

最佳答案

您需要为每个模块使用配置文件。放--threads:on进入<module name>.nim.cfg

关于nim-lang - 如何启用 --threads :on only for files using it?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74717623/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com