How to build x86 and/or x64 on Windows from command line with CMAKE?

后端 未结 3 1299
后悔当初
后悔当初 2020-12-07 08:42

One way to get cmake to build x86 on Windows with Visual Studio is like so:

  1. Start Visual Studio Command prompt for x86
  2. Run cmake: cmake -G \"NMa
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 08:51

    Besides CMAKE_GENERATOR_PLATFORM variable, there is also the -A switch

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

    https://cmake.org/cmake/help/v3.16/generator/Visual%20Studio%2016%202019.html#platform-selection

      -A            = Specify platform name if supported by
                                     generator.
    

提交回复
热议问题