From 416df1912872d406e2cef4ef2ff57f9373cac7bf Mon Sep 17 00:00:00 2001 From: Ranieri Althoff <1993083+ranisalt@users.noreply.github.com> Date: Fri, 30 Aug 2024 13:53:35 +0200 Subject: [PATCH] Cleanup enabling IPO in CMake (#4776) --- CMakeLists.txt | 7 ++----- src/CMakeLists.txt | 4 ---- src/http/CMakeLists.txt | 4 ---- src/http/tests/CMakeLists.txt | 4 ---- src/tests/CMakeLists.txt | 4 ---- 5 files changed, 2 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5f8c237fb..b9c47d4a18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,15 +105,12 @@ add_executable(tfs ${tfs_MAIN}) target_link_libraries(tfs tfslib) ### INTERPROCEDURAL_OPTIMIZATION ### -cmake_policy(SET CMP0069 NEW) include(CheckIPOSupported) check_ipo_supported(RESULT result OUTPUT error) if (result) - set(ENABLE_IPO ON) - set_target_properties(tfs PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - message(STATUS "IPO / LTO enabled") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) else () - message(STATUS "IPO / LTO not supported: <${error}>") + message(STATUS "IPO is not supported: ${error}") endif () ### END INTERPROCEDURAL_OPTIMIZATION ### diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 072c4807fc..3c09a5a534 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -188,10 +188,6 @@ if (APPLE) target_link_libraries(tfslib PRIVATE Iconv::Iconv) endif() -if (ENABLE_IPO) - set_target_properties(tfslib PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) -endif() - if (HTTP) add_subdirectory(http) target_link_libraries(tfslib PRIVATE http) diff --git a/src/http/CMakeLists.txt b/src/http/CMakeLists.txt index 11415d8e69..6dc831f10a 100644 --- a/src/http/CMakeLists.txt +++ b/src/http/CMakeLists.txt @@ -22,10 +22,6 @@ add_library(http OBJECT ${http_SRC}) target_link_libraries(http PRIVATE Boost::json) set_target_properties(http PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILD}) -if (ENABLE_IPO) - set_target_properties(http PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) -endif() - if (BUILD_TESTING) add_subdirectory(tests) endif() diff --git a/src/http/tests/CMakeLists.txt b/src/http/tests/CMakeLists.txt index f85c67f702..2ea00c4c63 100644 --- a/src/http/tests/CMakeLists.txt +++ b/src/http/tests/CMakeLists.txt @@ -8,9 +8,5 @@ foreach(test_src ${tests_SRC}) add_executable(${test_name} ${test_src}) target_link_libraries(${test_name} PRIVATE http tfslib Boost::unit_test_framework) - if (ENABLE_IPO) - set_target_properties(${test_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - endif() - add_test(NAME ${test_name} COMMAND ${test_name}) endforeach() diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 6af27f3267..2e6d1b1a6d 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -12,9 +12,5 @@ foreach(test_src ${tests_SRC}) add_executable(${test_name} ${test_src}) target_link_libraries(${test_name} PRIVATE tfslib Boost::unit_test_framework) - if (ENABLE_IPO) - set_target_properties(${test_name} PROPERTIES INTERPROCEDURAL_OPTIMIZATION True) - endif() - add_test(NAME ${test_name} COMMAND ${test_name}) endforeach()