gpt4 book ai didi

macos - 使用brew构建libgit2静态库

转载 作者:行者123 更新时间:2023-12-03 09:23:00 26 4
gpt4 key购买 nike

我想用brew构建libgit2的静态库。默认情况下,二进制文件仅包含动态库:

brew install libgit2

根据libgit2文档,我们需要将-DBUILD_SHARED_LIBS=OFF传递给cmake。如何让brew 将参数传递给cmake?我尝试过:

brew install libgit2 -DBUILD_SHARED_LIBS=OFF --build-from-source

但这并没有达到目的。

最佳答案

-DBUILD_SHARED_LIBS=OFF 附加到 libgit2 中使用的 cmake 参数formula你使用:

def install
args = std_cmake_args
...
args << "-DBUILD_SHARED_LIBS=OFF"
...

关于macos - 使用brew构建libgit2静态库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27680970/

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