Skip to content

Commit 8a63d7e

Browse files
committed
[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
1 parent 7a15da2 commit 8a63d7e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

sdk/cmake/host-tools.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ function(setup_host_tools)
9191
)
9292
endif()
9393

94+
if(NOT DEFINED HOST_BUILD_TYPE)
95+
set(HOST_BUILD_TYPE Release)
96+
endif()
97+
9498
ExternalProject_Add(host-tools
9599
SOURCE_DIR ${REACTOS_SOURCE_DIR}
96100
PREFIX ${REACTOS_BINARY_DIR}/host-tools
@@ -102,6 +106,8 @@ function(setup_host_tools)
102106
-DCMAKE_INSTALL_PREFIX=${REACTOS_BINARY_DIR}/host-tools
103107
-DTOOLS_FOLDER=${REACTOS_BINARY_DIR}/host-tools/bin
104108
-DTARGET_COMPILER_ID=${CMAKE_C_COMPILER_ID}
109+
-DTARGET_BUILD_TYPE=${CMAKE_BUILD_TYPE}
110+
-DCMAKE_BUILD_TYPE=${HOST_BUILD_TYPE}
105111
${CMAKE_HOST_TOOLS_EXTRA_ARGS}
106112
BUILD_ALWAYS TRUE
107113
INSTALL_COMMAND ${CMAKE_COMMAND} -E true

sdk/tools/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ if ((ARCH STREQUAL "amd64") AND (TARGET_COMPILER_ID STREQUAL "GNU"))
4848
add_subdirectory(gcc_plugin_seh)
4949
endif()
5050

51+
if (TARGET_BUILD_TYPE)
52+
# Silence warning about unused variable
53+
endif()
54+
5155
if(NOT MSVC)
5256
add_host_tool(pefixup pefixup.c)
5357
if (ARCH STREQUAL "amd64" OR ARCH STREQUAL "arm64")

0 commit comments

Comments
 (0)