From 6901d5393260905db598e2e13a00505a32a615c4 Mon Sep 17 00:00:00 2001 From: manon-traverse Date: Mon, 17 Aug 2026 10:49:24 +0200 Subject: [PATCH] build(android): give the host include-bin helper a .exe suffix on Windows When cross-compiling for Android the top-level CMake takes the UNIX path (the target, Android, is Unix) and builds the include-bin resource helper for the *host* via HOST_NATIVE_CPP_COMPILER. On a Windows host the output was named "include-bin" with no extension, which cmd.exe refuses to execute, breaking the build. Add a .exe suffix when CMAKE_HOST_WIN32 so the helper is runnable. Co-Authored-By: Claude Opus 4.8 --- renderdoc/CMakeLists.txt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt index 6db233c2efa..ae11a66ef65 100644 --- a/renderdoc/CMakeLists.txt +++ b/renderdoc/CMakeLists.txt @@ -493,13 +493,21 @@ if(UNIX) if(CMAKE_CROSSCOMPILING) set(HOST_NATIVE_CPP_COMPILER c++ CACHE STRING "Command to run to compile a .cpp into an executable. Default is just c++") - add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin + # The host helper must carry a .exe suffix when the host is Windows, else + # cmd.exe can't execute it (the target being Android makes UNIX true). + if(CMAKE_HOST_WIN32) + set(HOST_EXE_SUFFIX ".exe") + else() + set(HOST_EXE_SUFFIX "") + endif() + + add_custom_command(OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin${HOST_EXE_SUFFIX} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND ${HOST_NATIVE_CPP_COMPILER} 3rdparty/include-bin/main.cpp -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin + COMMAND ${HOST_NATIVE_CPP_COMPILER} 3rdparty/include-bin/main.cpp -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin${HOST_EXE_SUFFIX} DEPENDS 3rdparty/include-bin/main.cpp) - set(INCLUDE_BIN_EXE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin") - set(INCLUDE_BIN_DEP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin") + set(INCLUDE_BIN_EXE "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin${HOST_EXE_SUFFIX}") + set(INCLUDE_BIN_DEP "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/include-bin${HOST_EXE_SUFFIX}") else() add_executable(include-bin 3rdparty/include-bin/main.cpp) set(INCLUDE_BIN_EXE $)