gcc - CMake 如何检查工作编译器?

标签 gcc compiler-construction cmake

使用 CMake 时,我注意到输出消息:

-- The C compiler identification is GNU

-- The CXX compiler identification is GNU

-- Check for working C compiler: /usr/bin/gcc

-- Check for working C compiler: /usr/bin/gcc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done


我只是好奇 CMake 如何检查编译器是否工作以及 ABI 信息。

最佳答案

你可以很容易地看到自己。代码位于 CMake 模块 CMakeDetermineCCompiler.cmake , CMakeDetermineCompilerABI.cmake等等

您可以在 your_cmake_install/share/cmake-2.8/Modules 中找到这些模块.

关于gcc - CMake 如何检查工作编译器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15698881/

相关文章:

c++ - 程序加载/执行

c - 多个定义,包括开源库(具有看似正确的链接器设置?)

gcc - -O3 和 (-O2 + man gcc 说 -O3 添加到 -O2 的标志) 之间有什么区别?

gcc - valgrind、gcc 6.2.0 和 "-fsanitize=address"

compiler-construction - 如何流式传输程序代码?

haskell - LLVM 对 GHC 的调用约定

cmake - 如何使FeatureSummary包含pkg_check_modules找到的包

C2371 : 'mxArray' : redefinition; different basic types

c++ - 基于 CMake 的 CUDA 应用程序构建失败 - 没有文件传递给链接器

cmake - 如何在 CMake 中构建过程后复制目标的所有运行时依赖项?