[PATCH] Check the consistency of the C and C++ compilers picked-up by cmake

Arnaud Allard de Grandmaison arnaud.adegm at gmail.com
Thu Jun 13 14:24:49 PDT 2013


On Thu, Jun 13, 2013 at 10:58 PM, Reid Kleckner <rnk at google.com> wrote:

> The only usage of CMAKE_C(XX)_COMPILER_ID is for -fcolor-diagnostics.  Why
> not use the feature testing macro add_flag_if_supported() used elsewhere in
> the file?  I actually don't like those kinds of compiler tests because they
> make configuration slow, but that's the dominant style for all the other
> flag checking.
>

There are 2 things there :
 - using the add_flag_if_supported() for the colored diagnostics (with
Ninja only). I agree this would be a more idiomatic approach, and I will
update HandleLLVMOptions.cmake accordingly.
 - checking the consistency of the C and C++ toolchains. A side effect
would have been to catch the previous item, but this check is way broader
than color outputs. The point here is to catch suspicious setups. Can we
consider mixed toolchains as suspicious ?


On Thu, Jun 13, 2013 at 4:42 PM, Arnaud A. de Grandmaison <
> arnaud.adegm at gmail.com> wrote:
>
>> From time to time, it happens that cmake picks up inconsistent C and C++
>> compilers, especially for new comers or people not (yet) familiar with
>> their
>> development environment.
>>
>> This patch checks that both C and C++ compilers have the same ID (in cmake
>> parlance) : Gnu, clang, ... This would catch gross mistakes at an early
>> stage
>> (configuration) instead of failing way later during compilation.
>>
>> I am wondering though if we have some environment where such a mismatch is
>> expected. Any thoughts ?
>>
>> Cheers,
>> --
>> Arnaud A. de Grandmaison
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130613/869f2b54/attachment.html>


More information about the llvm-commits mailing list