[cmake] set policy CMP0138 NEW

with CMake >= 3.24 use the parent project compiler settings for
check_ipo_supported as it might fail otherwise.
This commit is contained in:
akallabeth 2024-01-24 14:02:57 +01:00 committed by akallabeth
parent f61d1fd66a
commit ebebc5b2a7

View File

@ -9,6 +9,9 @@ option(BUILD_SHARED_LIBS "Build shared libraries" ON)
# https://github.com/android/ndk/issues/1444 # https://github.com/android/ndk/issues/1444
if (NOT ANDROID) if (NOT ANDROID)
cmake_policy(SET CMP0069 NEW) cmake_policy(SET CMP0069 NEW)
if(CMAKE_VERSION GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0138 NEW)
endif()
include(CheckIPOSupported) include(CheckIPOSupported)
check_ipo_supported(RESULT supported OUTPUT error) check_ipo_supported(RESULT supported OUTPUT error)
if (NOT supported) if (NOT supported)