mdbx-cmake: add workaround for LTO on Android (https://reviews.llvm.org/D79919).

This commit is contained in:
Leonid Yuriev 2022-01-05 17:36:50 +03:00
parent 066bb696e3
commit 489f7a3136

View File

@ -448,8 +448,13 @@ if(CMAKE_COMPILER_IS_CLANG)
AND NOT (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux"
AND CMAKE_SYSTEM_NAME STREQUAL "Linux"))
OR APPLE))
if(ANDROID AND CMAKE_SYSTEM_VERSION VERSION_LESS 22)
set(CLANG_LTO_AVAILABLE FALSE)
message(STATUS "Link-Time Optimization by CLANG/LLVM is available but unusable due https://reviews.llvm.org/D79919")
else()
set(CLANG_LTO_AVAILABLE TRUE)
message(STATUS "Link-Time Optimization by CLANG/LLVM is available")
endif()
elseif(CMAKE_TOOLCHAIN_FILE AND NOT CMAKE_${CMAKE_PRIMARY_LANG}_COMPILER_VERSION VERSION_LESS 7.0)
set(CLANG_LTO_AVAILABLE TRUE)
if(NOT CMAKE_CLANG_LD)