Skip to content

Commit

Permalink
improve check
Browse files Browse the repository at this point in the history
  • Loading branch information
trittsv authored and eboasson committed Mar 22, 2023
1 parent 769b8dd commit 63b6eab
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@ if(ENABLE_LTO)
check_ipo_supported(RESULT ipo_supported OUTPUT error)
if(ipo_supported)
if(ANDROID AND "${CMAKE_ANDROID_ARCH_ABI}" STREQUAL "armeabi-v7a")
if("${CMAKE_ANDROID_ARCH_ABI}" STREQUAL "armeabi-v7a")
# clang android LTO bug (only armv7 affected)
# https://stackoverflow.com/questions/56238019/linker-error-when-enabling-link-time-optimization-in-ndk
# Fixed in newer clang versions: https://reviews.llvm.org/D79919
# But fixed here to keep supported android api level as low as possible
# Tested with android ndk v20.0.5594570 (android api 29)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto=full")
endif()
# clang android LTO bug (only armv7 affected)
# https://stackoverflow.com/questions/56238019/linker-error-when-enabling-link-time-optimization-in-ndk
# Fixed in newer clang versions: https://reviews.llvm.org/D79919
# But fixed here to keep supported android api level as low as possible
# Tested with android ndk v20.0.5594570 (android api 29)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto=full")
else()
set_property(TARGET ddsc PROPERTY INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
set_property(TARGET ddsc PROPERTY INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL TRUE)
Expand Down

0 comments on commit 63b6eab

Please sign in to comment.