Compare commits

..

2 Commits

View File

@ -1,12 +1,11 @@
# based on https://github.com/bluescarni/yacma # based on https://github.com/bluescarni/yacma
find_program(LSB_RELEASE NAMES lsb_release) if(LSB_DISTRIBUTOR_ID STREQUAL "AstraLinuxSE"
if (LSB_RELEASE) AND LSB_CODENAME STREQUAL "smolensk"
execute_process(COMMAND ${LSB_RELEASE} -d -s OUTPUT_VARIABLE LSB_DESC) AND LSB_RELEASE STREQUAL "1.5")
if ("${LSB_DESC}" STREQUAL "Astra Linux SE 1.5 (Smolensk)")
set(_CMAKE_TOOLCHAIN_PREFIX "x86_64-linux-gnu-") set(_CMAKE_TOOLCHAIN_PREFIX "x86_64-linux-gnu-")
set(_CMAKE_TOOLCHAIN_SUFFIX "-4.7") set(_CMAKE_TOOLCHAIN_SUFFIX "-4.7")
endif() set(_CMAKE_TOOLCHAIN_LOCATION} "/usr/bin")
endif() endif()
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
@ -99,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) 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) if(CMAKE_CXX_COMPILER_IS_GCC AND CXX_HAS_LTO_FLAG)
find_program(CMAKE_GCC_AR 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}) HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_GCC_NM 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}) HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_GCC_RANLIB 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}) HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB) if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")