enable IPO

This commit is contained in:
blueloveTH 2024-08-22 16:51:16 +08:00
parent 53fc4f36df
commit 953926342f

View File

@ -5,6 +5,15 @@ project(pocketpy)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# use IPO
include(CheckIPOSupported)
check_ipo_supported(RESULT result)
if(result)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
message(">> IPO is enabled")
endif()
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /utf-8 /jumptablerdata /GS-")
add_compile_options(/wd4267 /wd4244)