Don't use the program name to identify the compiler - it won't work

reliably in cases where the compiler is name /usr/bin/cc

Use the internal variable CMAKE_<LANG>_COMPILER_ID instead, which is
finally documented (but still called internal in the docs), see
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_LANG_COMPILER_ID


svn path=/trunk/; revision=50784
This commit is contained in:
Jörg Mayer 2013-07-22 09:36:14 +00:00
parent fb5a3b90d1
commit 43ef033128
1 changed files with 1 additions and 2 deletions

View File

@ -238,8 +238,7 @@ else() # TODO add alternate compiler flags for hiding symbols
" All shared library symbols will be exported.")
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER MATCHES ".*clang" OR
CMAKE_CXX_COMPILER MATCHES ".*clang")
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set (C_UNUSED "__attribute__((unused))" )
else()
set (C_UNUSED "" )