cd build
cmake -GNinja ..
ninja
./main
gcc -dM -E -x c /dev/null
gcc
sets __GNUC__
clang -dM -E -x c /dev/null
clang
sets __clang__
and __GNUC__
Demonstrates how to distinguish between GCC and Clang using predefines in the source code
C++BSD-3-Clause