How to fix Cmake The PLATFORM environment variable (x64) doesn't match the generator platform (win32)
Building in Windows Sandbox with
choco install -y winflexbison3 cmake activeperl python3 asciidoctorj xsltproc docbook-bundle visualstudio2019community visualstudio2019-workload-nativedesktop
Command prompt is titled "Administator: x64 Native Tools Command Prompt for VS 2019" and opens claiming to be "Visual Studio 2019 Developer Command Prompt v16.6.5".
WIRESHARK_BASE_DIR and QT5_BASE_DIR are set
cmake -G "Visual Studio 16 2019" -A x64 ..\wireshark-3.2.5
quits with:
CMake Error at CMakeLists.txt:91 (message):
The PLATFORM environment variable (x64) doesn't match the generator
platform (win32)
Also set WIRESHARK_TARGET_PLATFORM=win64 does not fix this. Any ideas how to persuade this to work?
Set reports:
Platform=x64
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
After opening the prompt, the banner should look like this:
and the last line indicates the target.
What does
set VSCMD_ARG_TGT_ARCH
report?And you should be setting
QT5_BASE_DIR
.Another thought, are you using a build directory that you've previously configured CMake for an x86 build? If so, create a new build dir, the x64 and x86 builds MUST be kept separate.
More output:
(more)This bit of output is odd, not sure what that means:
It should be something like:
The check in CMakeList.txt is failing because the WIRESHARK_TARGET_PLATFORM variable is incorrect ("win32").
That is set by the block:
So I would assume that the first conditional evaluates to false and the second to true. Can you add some debugging
message(STATUS "...")
items to dump out the value of{CMAKE_CL_64}
and{CMAKE_GENERATOR}
, e.g.add it just in front of the above block.