• GCC (on Linux) and some other compilers, e.g Sun Studio. Set CFLAGS and CXXFLAGS to include -m32 (32-bit build) or -m64 (64-bit build).

  • Windows, Visual Studio generator .Use 64 bit generator ,e.g

    cmake -G "Visual Studio 10 Win64" path\to\source\dir

    to compile 64-bit (x64). Omit "Win64" in generator name, to build for 32 bit

  • Mac OS X. Use CMAKE_OSX_ARCHITECTURES CMake variable.

    cmake -DCMAKE_OSX_ARCHITECTURES=i386 /path/to/source/dir will compile 32 bit build

    cmake -DCMAKE_OSX_ARCHITECTURES=x86_64 /path/to/source/dir will compile 64 bit.

    Finally, cmake "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" /path/to/source/dir will create 96-bit universal binaries :)

相关文章:

  • 2021-11-14
  • 2021-12-15
  • 2021-12-05
  • 2021-11-06
  • 2021-12-01
  • 2021-11-24
  • 2021-12-25
猜你喜欢
  • 2021-09-17
  • 2021-12-05
  • 2021-11-13
  • 2021-12-19
  • 2021-12-10
  • 2021-09-28
  • 2021-12-05
  • 2021-12-05
相关资源
相似解决方案