https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8a63d7e89865ce5c4ef03a4dd133b22564382606

commit 8a63d7e89865ce5c4ef03a4dd133b22564382606
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Sun Dec 1 14:29:04 2024 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sun Jan 19 09:02:58 2025 +0200

    [CMAKE] Build host-tools as release by default
    
    This setting can be overwritten by defining the CMake variable 
HOST_BUILD_TYPE.
    The target build type is passed to the host build as TARGET_BUILD_TYPE 
CMake variable.
    This improves time to build cab+iso:
    MSVC x86: 37s -> 28s
    GCC x86: 32s -> 16s
---
 sdk/cmake/host-tools.cmake | 6 ++++++
 sdk/tools/CMakeLists.txt   | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/sdk/cmake/host-tools.cmake b/sdk/cmake/host-tools.cmake
index b7932a82bb8..e2349b8841d 100644
--- a/sdk/cmake/host-tools.cmake
+++ b/sdk/cmake/host-tools.cmake
@@ -91,6 +91,10 @@ function(setup_host_tools)
             )
     endif()
 
+    if(NOT DEFINED HOST_BUILD_TYPE)
+        set(HOST_BUILD_TYPE Release)
+    endif()
+
     ExternalProject_Add(host-tools
         SOURCE_DIR ${REACTOS_SOURCE_DIR}
         PREFIX ${REACTOS_BINARY_DIR}/host-tools
@@ -102,6 +106,8 @@ function(setup_host_tools)
             -DCMAKE_INSTALL_PREFIX=${REACTOS_BINARY_DIR}/host-tools
             -DTOOLS_FOLDER=${REACTOS_BINARY_DIR}/host-tools/bin
             -DTARGET_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+            -DTARGET_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+            -DCMAKE_BUILD_TYPE=${HOST_BUILD_TYPE}
             ${CMAKE_HOST_TOOLS_EXTRA_ARGS}
         BUILD_ALWAYS TRUE
         INSTALL_COMMAND ${CMAKE_COMMAND} -E true
diff --git a/sdk/tools/CMakeLists.txt b/sdk/tools/CMakeLists.txt
index f7f4fd2ccce..0ad7a992d4d 100644
--- a/sdk/tools/CMakeLists.txt
+++ b/sdk/tools/CMakeLists.txt
@@ -48,6 +48,10 @@ if ((ARCH STREQUAL "amd64") AND (TARGET_COMPILER_ID STREQUAL 
"GNU"))
     add_subdirectory(gcc_plugin_seh)
 endif()
 
+if (TARGET_BUILD_TYPE)
+    # Silence warning about unused variable
+endif()
+
 if(NOT MSVC)
     add_host_tool(pefixup pefixup.c)
     if (ARCH STREQUAL "amd64" OR ARCH STREQUAL "arm64")

Reply via email to