【发布时间】:2015-04-05 16:14:59
【问题描述】:
让 cmake 在 Windows 上使用 Visual Studio 构建 x86 的一种方法如下:
- 为 x86 启动 Visual Studio 命令提示符
- 运行cmake:
cmake -G "NMake Makefiles" \path_to_source\ - nmake
让 cmake 在 Windows 上使用 Visual Studio 构建 x64 的一种方法如下:
- 为 x64 启动 Visual Studio 命令提示符
- 运行cmake:
cmake -G "NMake Makefiles" \path_to_source\ - nmake
使用 Cmake,我如何编译一个或两个架构? (就像 Visual Studio 在 IDE 中的做法一样)
【问题讨论】:
-
这里相同,但似乎有一个解决方案:zeroset.mnim.org/2015/07/15/…(并且不关闭提示,并使用
nmake) -
如果您来到这里是因为您在 Windows 上使用
-G"Ninja"作为生成器;构建 32bit 使用 "x86 Native Tools Command Prompt" 构建 64bit 使用 "x64 Native Tools Command Prompt",它将使用正确的库、编译器和链接器。跨度>
标签: c visual-studio cmake cross-compiling x86-64