c++ - How to compile C++ for Mac OS X using Visual Studio on Windows and CMake
问题描述
I read that Visual Studio
now supports cross-platform development. I'm using CMake
to compile for Windows
and Ubuntu
(using WSL
) so far. However there doesn't seem to be any information on how to actually accomplish the cross-compilation using Visual Studio
to target Mac OS X
. Is it doable with the CMakeSettings.json
? According to this article, you can choose Linux-Debug
and Linux-Release
as configurationType
but in Visual Studio 2017 Enterprise
the Linux
options aren't even available for me, neither is Mac OS X
.
I might just setup a virtual machine as suggested in this post which seems to be the most convenient solution to get the job done.
解决方案
显然你不能。
我最终安装了一个虚拟机,Mac OS X
并使用共享文件夹成功地在其中编译了我的代码,以使我的Windows
主机源代码可供来宾使用。这肯定比一些 hacky 交叉编译项目更可靠、更理智。后者仍然不能保证代码能够成功运行并且不会在交叉编译目标操作系统上意外崩溃。
推荐阅读
- google-photos - Google Photo API 方法:albums.patch "isWriteable": true 不工作
- swiftui - SwiftUI NavigationLink 自行弹出
- elasticsearch - ElasticSearch 绑定服务失败
- amazon-web-services - PHP 会话在 AWS beanstalk 和 memcached 上不起作用
- mysql - 如何在 MySQL Workbench 中添加特定于列的现有表?
- python - 在 Windows 中安装 GNU gettext 的最佳解决方案是什么?
- css - 如何通过 Material UI MenuProps 传递 Emotion 样式以覆盖纸张根类
- python - 从用户表单网页中提取文本,HTML 不包含所需的文本(python,selenium)
- python - 存储扩展名为 .model 的 PyTorch 模型文件和存储扩展名为 .pkl 的模型文件有什么区别?
- javascript - 打字稿与普通类型声明相比?