![]() ![]() By default this generator uses the 32-bit variant even on a 64-bit host. However, if I pass -DCMAKE_GENERATOR_PLATFORM=Win32 during configuration from the commandline, the build works fine! But that is literally same as -A Win32, even more verbose. New in version 3.8: For each toolset that comes with this version of Visual Studio, there are variants that are themselves compiled for 32-bit ( x86) and 64-bit ( 圆4) hosts (independent of the architecture they target). CMAKE_VS_PLATFORM_NAME_DEFAULT also does not help, leading me to believe they are read-only variables used simply to indicate from inside CMake itself, which platform was used. If I replace setting CMAKE_GENERATOR_PLATFORM with CMAKE_VS_PLATFORM_NAME, the variable is seemingly ignored. Finally, there is the mention that “ On Visual Studio Generators the selected platform name is provided in the CMAKE_VS_PLATFORM_NAME variable.”. This CMakePreset.json seems to do the job: /cmake-default-toolchain.cmake) One may explicitly request use of either the 32-bit or 64-bit. But the less flags you have to remember for the build - the better.Īs I am for a moment not limited by a CMake Version, I figured I could finally try out CMake Presets. By default this generator uses the 64-bit variant on 圆4 hosts and the 32-bit variant otherwise. The correct incantation for configuration should be cmake -B builddir -A Win32. Yet for modern VS versions the default bitness is “same-as-host” - so when the project is configured and built on a regular 圆4 system with simple cmake -B builddir & cmake -build builddir, everything falls apart. I am currently porting to CMake a VS project that can be built only as 32-bit application. "How to force architecture of the build in the project itself?" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |