diff --git a/CMLibCompilerFlags.cmake b/CMLibCompilerFlags.cmake index 40af045..09bb679 100644 --- a/CMLibCompilerFlags.cmake +++ b/CMLibCompilerFlags.cmake @@ -1,5 +1,13 @@ # based on https://github.com/bluescarni/yacma +if(LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE" AND + LSB_CODENAME STREQUAL "smolensk" AND + LSB_RELEASE STREQUAL "1.5") + set(_CMAKE_TOOLCHAIN_PREFIX "x86_64-linux-gnu-") + set(_CMAKE_TOOLCHAIN_SUFFIX "-4.7") + set(_CMAKE_TOOLCHAIN_LOCATION} "/usr/bin") +endif() + include(CheckCXXCompilerFlag) macro(CHECK_ENABLE_CXX_FLAG flag) @@ -90,13 +98,16 @@ if(CMAKE_CXX_COMPILER_IS_CLANG OR CMAKE_CXX_COMPILER_IS_INTEL OR CMAKE_CXX_COMPI check_cxx_compiler_flag(-fno-fat-lto-objects CXX_HAS_NO_FAT_LTO_FLAG) if(CMAKE_CXX_COMPILER_IS_GCC AND CXX_HAS_LTO_FLAG) find_program(CMAKE_GCC_AR - NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} + NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX}" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar" HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_GCC_NM - NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm + NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm${_CMAKE_TOOLCHAIN_SUFFIX}" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm" HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_GCC_RANLIB - NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib + NAMES "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib${_CMAKE_TOOLCHAIN_SUFFIX}" + "${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib" HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")