检查我是否拥有32位或64位Linux的最佳方法是什么? [英] What is the best way to check if I have a 32-bit or a 64-bit Linux?
本文介绍了检查我是否拥有32位或64位Linux的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须签入CMake脚本(如果我具有32位或64位Linux),以便了解如何构建C ++程序.哪个命令是最佳选择:
I have to check in CMake script if I have a 32-bit or a 64-bit Linux in order to know how to build a C++ program. Which command is the best choice :
- getconf LONG_BIT
- arch
- uname -m
推荐答案
Using CMake one possible way is to check the CMAKE_SIZEOF_VOID_P variable:
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
message (STATUS "Compiling for 64-bit")
endif()
这篇关于检查我是否拥有32位或64位Linux的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文