From 77401af4852103b215fe74989e89be61bbf435d2 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 13 Mar 2025 01:20:52 +0100 Subject: [PATCH] cmake: unity mode optimization for non-`CURLDEBUG` `testdeps` targets Include more sources in unity mode to optimize libtest and tests/server builds for non-debug-enabled builds, syncing this pattern with `lib` and `src`. It reduces build steps from 62 to 47 (-14, -24%) with test bundles. Without test bundles, from 680 to 642 (-38, -6%). Follow-up to de0693f24943cd65f26a7b421a4304cbadb875a0 #16274 Follow-up to 3efba94f773db5d8ae19e33aa749ab7914cafeea #14765 Cherry-picked from #15000 Closes #16695 --- tests/libtest/CMakeLists.txt | 4 +++- tests/server/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index f5f6a0d10c..60b1bd42f4 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -27,7 +27,9 @@ curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -set_source_files_properties("../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +if(ENABLE_CURLDEBUG) + set_source_files_properties("../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +endif() add_custom_command( OUTPUT "lib1521.c" diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 3b18bba4c3..b7bd88151e 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -26,7 +26,9 @@ curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -set_source_files_properties("../../lib/memdebug.c" "../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +if(ENABLE_CURLDEBUG) + set_source_files_properties("../../lib/memdebug.c" "../../lib/curl_multibyte.c" PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +endif() foreach(_target IN LISTS noinst_PROGRAMS) set(_target_name "${_target}") -- 2.47.2