简体   繁体   English

在 macOS 中静态编译 Nim 程序

[英]statically compile a Nim program in macOS

I'm writing a program in Nim using the zip/zipfiles library, which relies on libzip(|2|4).dylib .我正在使用依赖于libzip(|2|4).dylibzip/zipfiles库在 Nim 中编写程序。

My question is primarily for macOS, but guidance for Linux is also welcome.我的问题主要针对 macOS,但也欢迎针对 Linux 提供指导。

How can I compile it to have a statically linked binary to be easier to distribute?如何将其编译为具有静态链接的二进制文件以便更容易分发?

Thanks Andrea谢谢安德里亚

EDIT: Apparently something like https://nim-lang.org/docs/nimc.html#dynliboverride should do.编辑:显然像https://nim-lang.org/docs/nimc.html#dynliboverride这样的事情应该做。 Specifically for this library, -p:useLibzipSrc also does.专门针对这个库, -p:useLibzipSrc也可以。

-d:useLibzipSrc源代码,您似乎可以通过传递-d:useLibzipSrc来做到这-d:useLibzipSrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM