Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does CMake check for a working compiler?

When using CMake, I noticed the output messages:

-- 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

I am just curious about how CMake checks if the compiler works and the ABI information.

like image 914
Alex Duan Avatar asked Mar 29 '13 07:03

Alex Duan


1 Answers

You can easily see for yourself. The code is located in CMake modules CMakeDetermineCCompiler.cmake, CMakeDetermineCompilerABI.cmake etc.

You can find these modules in your_cmake_install/share/cmake-2.8/Modules.

like image 60
Angew is no longer proud of SO Avatar answered Oct 06 '22 02:10

Angew is no longer proud of SO