cmlib/CMLibCompiler.cmake

47 lines
1.8 KiB
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")
2019-02-12 16:31:17 +00:00
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)
2020-04-01 18:42:59 +00:00
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
2019-02-12 16:31:17 +00:00
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()
2020-06-25 08:30:48 +00:00
# Предпочтительные пути к утилитам для компоновки
if(CMAKE_CXX_COMPILER_IS_GCC)
find_program(
CMAKE_GCC_AR NAMES "/usr/e2k-linux/bin/ar" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar" "ar" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_AR)
set(CMAKE_AR ${CMAKE_GCC_AR} CACHE STRING "" FORCE)
endif()
find_program(
CMAKE_GCC_NM NAMES "/usr/e2k-linux/bin/nm" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm" "nm" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_NM)
set(CMAKE_NM ${CMAKE_GCC_NM} CACHE STRING "" FORCE)
endif()
find_program(
CMAKE_GCC_RANLIB
NAMES "/usr/e2k-linux/bin/ranlib" "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_TOOLCHAIN_SUFFIX}"
"${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib" "ranlib" HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_RANLIB)
set(CMAKE_RANLIB ${CMAKE_GCC_RANLIB} CACHE STRING "" FORCE)
endif()
endif()