Skip to content

Commit

Permalink
cmake: Enable LTO if compiler in build environment supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
MajorP93 committed Dec 1, 2024
1 parent 5f4d031 commit 5fc0091
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,16 @@ target_link_libraries(shadps4 PRIVATE Boost::headers GPUOpen::VulkanMemoryAlloca
target_compile_definitions(shadps4 PRIVATE IMGUI_USER_CONFIG="imgui/imgui_config.h")
target_compile_definitions(Dear_ImGui PRIVATE IMGUI_USER_CONFIG="${PROJECT_SOURCE_DIR}/src/imgui/imgui_config.h")

# Enable link-time optimization if compiler in current environment supports it
include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported)
if(ipo_supported)
message(STATUS "IPO is supported")
set_property(TARGET shadps4 PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(WARNING "IPO is not supported")
endif()

if (APPLE)
option(USE_SYSTEM_VULKAN_LOADER "Enables using the system Vulkan loader instead of directly linking with MoltenVK. Useful for loading validation layers." OFF)
if (USE_SYSTEM_VULKAN_LOADER)
Expand Down

0 comments on commit 5fc0091

Please sign in to comment.