5 个版本
0.2.6 | 2023 年 10 月 27 日 |
---|---|
0.2.5 | 2023 年 5 月 18 日 |
0.2.4 | 2023 年 5 月 18 日 |
0.2.2 | 2023 年 3 月 28 日 |
0.2.0 | 2023 年 3 月 21 日 |
#121 in 构建工具
每月 151 次下载
用于 12 crates
11KB
170 行
coin-build-tools
coin-build-tools
提供了一套从源代码构建 [Coin-OR] 库的工具。
用法
只需将以下内容添加到您的 Cargo.toml
[build-dependencies]
coin-build-tools = "0.2"
配置
默认情况下,该软件包从源代码构建并静态链接。它还提供了以下环境变量,允许用户自定义链接到系统库
CARGO_${LIB_NAME}_STATIC
用于静态链接 CoinUtils;CARGO_${LIB_NAME}_SYSTEM
用于链接到 CoinUtils 系统库;
将环境变量设置为 1
以启用该功能。例如,要动态链接到系统库,将 CARGO_${LIB_NAME}_SYSTEM
设置为 1
;要静态链接到系统库,将 CARGO_${LIB_NAME}_SYSTEM
和 CARGO_${LIB_NAME}_STATIC
都设置为 1
。
Windows 和 vcpkg
在Windows上,如果 ${LIB_NAME}_SYSTEM
设置为 1
,则 osi-src
将使用 vcpkg 来查找Osi。在构建之前,您必须为目标三元组和链接类型安装正确的Osi。例如,为了为 x86_64-pc-windows-msvc
工具链动态链接,安装 osi
的 x64-windows
三元组
vcpkg install osi --triplet x64-windows
要静态链接Osi,为 x64-windows-static-md
三元组安装 osi
vcpkg install osi --triplet x64-windows-static-md
要静态链接Osi和C运行时(CRT),为 x64-windows-static
三元组安装 osi
vcpkg install osi --triplet x64-windows-static
并使用 +crt-static
选项进行构建
RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc
请参阅《Rust参考》中的“静态和动态C运行时”以获取详细信息。
交叉编译
您可以通过为 --target
选项提供 cargo build
提供其他目标。
目标 | 支持 |
---|---|
arm-unknown-linux-gnueabi |
✓ |
arm-unknown-linux-gnueabihf |
✓ |
armv7-linux-androideabi |
✓ |
armv7-unknown-linux-gnueabi |
✓ |
armv7-unknown-linux-gnueabihf |
✓ |
armv7-unknown-linux-musleabi |
✓ |
armv7-unknown-linux-musleabihf |
✓ |
riscv64gc-unknown-linux-gnu |
✓ |
x86_64-pc-windows-gnu |
✓ |
x86_64-unknown-linux-gnu |
✓ |
贡献
您的贡献非常受重视。请不要犹豫,提出问题或发送pull request。请注意,任何提交给项目包括在内的贡献将根据 LICENSE 中给出的条款进行许可。
依赖项
~420–590KB