货物构建脚本以检测目标最小值和最大MacOS版本?
我正在为C库编写一个Rust包装器,该库有条件地需要uniformTypeIdentifiers
框架,具体取决于__ mac_os_os_os_os_x_version_min_lowled
和__ mac_os_os_os_os_os_x_x_max_max_max_max_allowed
UnibrolTypeIdentifiers 库(最近引入了),因为现在正在弃用旧的做事方式。
是否有一种方法可以在build.rs
中获取这两个值(针对目标的最小和最大MACOS版本),以便我可以决定是否发射货物:Rustc-link-lib-lib = framework =链接库的UnibrolTypeIdentifier
行?我不能一直发出它,因为在较旧的Mac上,这将导致构建错误,因为库将不可用。
I'm writing a Rust wrapper for a C library that conditionally requires the UniformTypeIdentifiers
framework depending on the values of __MAC_OS_X_VERSION_MIN_ALLOWED
and __MAC_OS_X_VERSION_MAX_ALLOWED
(which are the minimum and maximum macOS versions targeted). The C library does conditional compilation that uses the UniformTypeIdentifiers
library (which was introduced recently) because the old way of doing things is now deprecated.
Is there a way to obtain these two values (the minimum and maximum macOS versions targeted) in build.rs
so that I can decide whether to emit the cargo:rustc-link-lib=framework=UniformTypeIdentifiers
line that links the library? I can't simply emit it all the time, because on older Macs this will lead to a build error, since the library would be unavailable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论