找出构建的目标平台?
我如何找出 SCons 正在构建的平台(Linux、Mac OS X、Windows 等——与架构无关)。
How do I find out what platform SCons is building for (Linux, Mac OS X, Windows, &c-- not concerned with architecture).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
创建环境后,您还可以使用
env['PLATFORM']
。我认为它来自 sys.platform。You can also use
env['PLATFORM']
once you've created an Environment. I think it comes from sys.platform.将 http://docs.python.org/library/platform.html#platform .platform(真,真)
做你想做的事?如果没有,您可能必须自己根据另一个中的数据进行映射
平台方法。
Will http://docs.python.org/library/platform.html#platform.platform (true,true)
do what you want? If not you may have to map it yourself from data in the other
platform methods.
Scons 有一个内置函数
Platform()
,您可以在创建环境之前调用该函数。使用Platform()
可能比使用 Python 的platform.platform(true, true)
更好(例如,您不必将 platform 导入到 SConstruct 中。)创建环境后,您应该按照 @GaryO 的建议使用env['PLATFORM']
。Scons has a builtin function
Platform()
that you can call before you create your Environment. Probably preferable to usePlatform()
than Python'splatform.platform(true, true)
(you don't have to import platform into you SConstruct, for example.) After you've created your environment you should useenv['PLATFORM']
as suggested by @GaryO.