Detect case of C++ compiler being a C-only compiler
This is purely a convenience/enhancement request...
CMake makes some attempt to verify the C++ compiler does actually compile C++ programs (so, if you export CXX=ls
, you'll get an error). However, if you mix up your C and C++ compiler, e.g. export CXX=clang
, CMake configuration and generation will likely succeed, and you may get weird errors later on. Specifically, compilation of .cpp
files may work - but linking may fail.
So please try to validate the C++ compiler in a way in which clang
and gcc
(but obviously not clang++
or g++
) would fail.
Edited by Eyal Rozenberg