47 lines
1.8 KiB
CMake
47 lines
1.8 KiB
CMake
# 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()
|
|
|
|
# Предпочтительные пути к утилитам для компоновки
|
|
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()
|