- Simplify CMake GCC and Clang checking.

Introduce the variable 'ZD_CMAKE_COMPILER_IS_GNUC(XX)_COMPATIBLE' and replace any occurrence of '"${CMAKE_C(XX)_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C(XX)_COMPILER_ID}" STREQUAL "Clang"' with it. This makes it possible to add more GCC compatible compilers in just one place.
This commit is contained in:
Edoardo Prezioso 2014-06-26 01:23:41 +02:00
parent 8aff59e704
commit 1a3ac9d0b3
9 changed files with 42 additions and 29 deletions

View file

@ -2,9 +2,9 @@ cmake_minimum_required( VERSION 2.4 )
make_release_only()
if( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -fomit-frame-pointer" )
endif( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
endif( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE )
add_library( jpeg
jcomapi.c