From 11e1f93fd2f68eaaf30d3f4781a359bc12b019e2 Mon Sep 17 00:00:00 2001 From: Edgar Date: Mon, 4 Mar 2024 11:31:51 +0100 Subject: [PATCH] Fix v8_torque_generated failing to build on Windows (#82) The torque-outputs and torque_outputs variables can have too many characters on Windows to be executed on the command line, so we have to write it to a temporary file and execute that. Fixes: https://github.com/bnoordhuis/v8-cmake/issues/42 Fixes: https://github.com/bnoordhuis/v8-cmake/issues/67 --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 143fcb03..4467e77e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -999,6 +999,12 @@ target_include_directories(v8_torque_generated ${PROJECT_SOURCE_DIR}/v8 ) +# The torque-outputs and torque_outputs variables can have too many characters +# on Windows to be executed on the command line, so we have to write it to a +# temporary file and execute that +file(WRITE "${PROJECT_BINARY_DIR}/touch_torque_outputs.cmake" + "file(TOUCH ${torque-outputs};${torque_outputs})") + add_custom_command( COMMAND torque @@ -1006,7 +1012,7 @@ add_custom_command( -v8-root ${PROJECT_SOURCE_DIR}/v8 ${torque_files} COMMAND - ${CMAKE_COMMAND} -E touch ${torque-outputs} ${torque_outputs} + ${CMAKE_COMMAND} -P ${PROJECT_BINARY_DIR}/touch_torque_outputs.cmake DEPENDS torque ${torque_dirs}