如何使用cmake从Visual Studio构建为ia32解决方案 [英] How to build as an ia32 solution from visual studio using cmake
问题描述
我有一个使用 cmake
的模块项目,其配置如下:
I have a module project using cmake
with the following configuration:
cmake_minimum_required(VERSION 3.13)
project(app)
set(CMAKE_CXX_STANDARD 11)
add_library(app MODULE src/library.cpp src/library.h)
使用 cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE = Release
生成的解决方案之后,我可以找到一个 app.sln
解决方案.
Once solution generated using cmake .. -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release
, I can find an app.sln
solution.
我使用 Visual Studio 2019
打开它,然后单击 Local Windows Debugger
按钮.我还可以看到一个下拉菜单,其中包含值 x64
和一个项 Configuration Manager
.
I open it with Visual Studio 2019
and click on the button Local Windows Debugger
. I can see also a drop-down menu containing the value x64
and an item Configuration Manager
.
默认情况下为什么没有 ia32
或 x86
选项?我只是无法创建新配置,因为该配置完全不友好.
Why isn't there an ia32
or x86
option by default? I just can't create a new configuration since the configuration is totally non user friendly.
有人想过为目标 32位
程序编译库吗?
Anyone has an idea for compile the library for target 32 bits
programs?
编辑
我现在使用 cmake进行编译.-G"Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM = x86 -DCMAKE_BUILD_TYPE = Release
,甚至无法加载该项目(因为Visual中缺少一些配置,因为工作室,这就是IDE所说的)
I now compile using cmake .. -G "Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM=x86 -DCMAKE_BUILD_TYPE=Release
and the project couldn't be even loaded (cuz of some missing configuration on visual studio, that's what the IDE say)
推荐答案
It appears from the VS 2019 version of the cmake documentation that you should only need to specify:
cmake -G "Visual Studio 16 2019" -A Win32
我将使事情尽可能简单,让 cmake
发挥作用.
and I would keep things as simple as possible and let cmake
do its job.
不确定上次评论中什么都没有发生"的意思.当然发生了什么,但是发生的不是您期望或想要的.
Not sure what you mean by "nothing happens" in your last comment. Surely something happened however what happened is not what you expected or wanted.
这篇关于如何使用cmake从Visual Studio构建为ia32解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!