Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 5fd72b8

Browse files
authored
Update CMakeLists.txt
1 parent c49d724 commit 5fd72b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ include_directories(../mupen64plus-core/src/api)
1010
add_definitions(-DM64P_PLUGIN_API)
1111
add_definitions(-DPARALLEL_INTEGRATION)
1212

13+
# check for INTERPROCEDURAL_OPTIMIZATION support
14+
if((${CMAKE_VERSION} VERSION_EQUAL 3.9) OR (${CMAKE_VERSION} VERSION_GREATER 3.9))
15+
cmake_policy(SET CMP0069 NEW)
16+
17+
include(CheckIPOSupported)
18+
check_ipo_supported(RESULT ENABLE_IPO)
19+
if(ENABLE_IPO)
20+
message("Interprocedural optimizations enabled")
21+
endif(ENABLE_IPO)
22+
endif()
23+
24+
if(ENABLE_IPO AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
25+
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
26+
endif()
27+
1328
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
1429
set(PARALLEL_RSP_CXX_FLAGS -Wall -Wextra -Wno-missing-field-initializers -Wno-empty-body -ffast-math -Wno-unused-parameter)
1530
elseif (MSVC)

0 commit comments

Comments
 (0)