add PK_BUILD_WITH_IPO

This commit is contained in:
blueloveTH 2024-11-08 17:33:08 +08:00
parent 8a98208a75
commit 1ea83cf10b

View File

@ -6,10 +6,11 @@ set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# use IPO
option(PK_BUILD_WITH_IPO "" TRUE)
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result AND NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(result AND PK_BUILD_WITH_IPO)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING ">> IPO disabled. You will not get the best performance.")