无法使用host = x86或-A Win32为Visual Studio 2019生成32位配置

无法使用host = x86或-A Win32为Visual Studio 2019生成32位配置

问题描述:

我正在尝试将cmake配置为分别为32位和64位构建...

I am trying to configure cmake to build for 32bit and 64bit separately...

到目前为止,64bit很容易,因为我只需要添加-A x64

So far 64bit is easy as I just need to add -A x64

cmake -G "Visual Studio 16 2019" -A x64

但是我无法设置32位拱. 官方文档建议-A Win32或-T host = x86
https://cmake.org/cmake/help/Latest/generator/Visual%20Studio%2016%202019.html
即使有了它们,我也无法设置x86主机

But I am not able to set 32bit arch. Official documentation suggest -A Win32 or -T host=x86
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html
Even with them I am not able to set x86 host

我尝试过的:

cmake -G "Visual Studio 16 2019" -DCMAKE_GENERATOR_PLATFORM=x86

cmake -G "Visual Studio 16 2019" -A Win32

cmake -G "Visual Studio 16 2019" -A Win32 -T host=x86

cmake -G "Visual Studio 16 2019" -A Win32 host=x86

什么都没用,这是我一直在获取的日志...

Nothing is working, Here is log I am getting all the time...

-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.25.28612.0
-- The CXX compiler identification is MSVC 19.25.28612.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe

它与node-js有关...
我刚刚用Win32编写了generator,并在package.json的node-js部分中传递了拱

It was related to node-js...
I just wrote generator with Win32 and passed arch in node-js part of package.json

npm config set cmake_js_arch ia32 && cmake-js compile cmake -G \"Visual Studio 16 2019\" -A Win32

我正在使用cmake为节点项目构建c ++代码DLL,因此有必要从命令行运行它.

I am using cmake to build c++ code DLL for a node project, So it is necessary to run it from command line.

cmake-js是Cmake的节点程序包,该命令告诉cmake-js设置arch ia32

cmake-js is a node package for Cmake and that command is telling cmake-js to set arch ia32