cmlib/CMLibCompiler.cmake

25 lines
800 B
CMake
Raw Normal View History

2019-02-12 16:31:17 +00:00
# C compiler name
if(CMAKE_C_COMPILER_ID STREQUAL "Intel")
set(CMAKE_C_COMPILER_IS_INTEL ON)
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_C_COMPILER_IS_CLANG ON)
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(CMAKE_C_COMPILER_IS_GCC ON)
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_C_COMPILER_IS_MSVC ON)
endif()
# C++ compiler name
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(CMAKE_CXX_COMPILER_IS_INTEL ON)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
set(CMAKE_CXX_COMPILER_IS_CLANG ON)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_COMPILER_IS_GCC ON)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_COMPILER_IS_MSVC ON)
endif()