https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7197620b894a52100fc56…
commit 7197620b894a52100fc568a1b8f15e38b17587c5
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Apr 29 22:14:41 2021 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Mon May 3 22:00:57 2021 +0200
[CMAKE] Always use cl to build host tools
---
sdk/cmake/host-tools.cmake | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/sdk/cmake/host-tools.cmake b/sdk/cmake/host-tools.cmake
index 5d426e1b863..fe9b449fa84 100644
--- a/sdk/cmake/host-tools.cmake
+++ b/sdk/cmake/host-tools.cmake
@@ -11,6 +11,7 @@ function(setup_host_tools)
COMMAND ${CMAKE_C_COMPILER} --print-file-name=plugin
OUTPUT_VARIABLE GCC_PLUGIN_DIR)
string(STRIP ${GCC_PLUGIN_DIR} GCC_PLUGIN_DIR)
+ list(APPEND CMAKE_HOST_TOOLS_EXTRA_ARGS -DGCC_PLUGIN_DIR=${GCC_PLUGIN_DIR})
list(APPEND HOST_MODULES gcc_plugin_seh)
endif()
list(TRANSFORM HOST_TOOLS PREPEND "${REACTOS_BINARY_DIR}/host-tools/bin/"
OUTPUT_VARIABLE HOST_TOOLS_OUTPUT)
@@ -25,6 +26,13 @@ function(setup_host_tools)
set(HOST_MODULE_SUFFIX ".so")
endif()
+ # CMake might choose clang if it finds it in the PATH. Always prefer cl for host
tools
+ if (MSVC)
+ list(APPEND CMAKE_HOST_TOOLS_EXTRA_ARGS
+ -DCMAKE_C_COMPILER=cl
+ -DCMAKE_CXX_COMPILER=cl)
+ endif()
+
ExternalProject_Add(host-tools
SOURCE_DIR ${REACTOS_SOURCE_DIR}
PREFIX ${REACTOS_BINARY_DIR}/host-tools
@@ -34,8 +42,8 @@ function(setup_host_tools)
-DARCH:STRING=${ARCH}
-DCMAKE_INSTALL_PREFIX=${REACTOS_BINARY_DIR}/host-tools
-DTOOLS_FOLDER=${REACTOS_BINARY_DIR}/host-tools/bin
- -DGCC_PLUGIN_DIR=${GCC_PLUGIN_DIR}
-DTARGET_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ ${CMAKE_HOST_TOOLS_EXTRA_ARGS}
BUILD_ALWAYS TRUE
INSTALL_COMMAND ${CMAKE_COMMAND} -E true
BUILD_BYPRODUCTS ${HOST_TOOLS_OUTPUT}