[llvm-commits] Improved Covered Default Switch detection

Óscar Fuentes ofv at wanadoo.es
Sun Nov 25 16:07:18 PST 2012


Eli Friedman <eli.friedman at gmail.com>
writes:

> On Sun, Nov 25, 2012 at 3:19 PM, Joe Abbey <jabbey at arxan.com> wrote:
>> If cmake happens to detect GCC for the C compiler and Clang for the C++
>> compiler, then a manual override of either the C compiler or
>> SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG is required.  This has been happening
>> on my Darwin build environments:
>>
>> -- The C compiler identification is GNU 4.2.1
>> -- The CXX compiler identification is Clang 4.1.0
>
> How did you end up in this situation?  Something has gone very wrong
> if the build system finds clang++ but not clang.

It just happened to me a few hours ago, after using
-DCMAKE_CXX_COMPILER=(/path/to/)clang++. CMake is doing what is asked:
use clang++ as the C++ compiler and the system default (gcc) as the C
compiler. The same can be achieved with the traditional build with

CXX=/path/to/clang++ ./configure && make

I worked around the problem by adding -DCMAKE_C_COMPILER=/path/to/clang.
Unless there is a good reason for rejection such use, the build system
should not force you to use clang when you want clang++.




More information about the llvm-commits mailing list