Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: windows build (#73,#67) #74

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 47 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -977,17 +977,59 @@ add_custom_command(
-o ${PROJECT_BINARY_DIR}/torque-generated
-v8-root ${PROJECT_SOURCE_DIR}/v8
${torque_files}
COMMAND
${CMAKE_COMMAND} -E touch ${torque-outputs} ${torque_outputs}
DEPENDS
torque
${torque_dirs}
${torque_files_abs}
OUTPUT
${torque-outputs}
${torque_outputs}
TARGET
v8_torque_generated
)

if(WIN32)
# Windows has a limit on the number of command line arguments. To work around
# Split the files into groups of 200 and touch them in groups.

set(torque_outputs_per_command 200)
set(torque_outputs_full ${torque_outputs} ${torque-outputs})
list(LENGTH torque_outputs_full torque_outputs_full_length)
math(EXPR torque_outputs_last_index "${torque_outputs_full_length} - 1")

foreach (start RANGE 0 ${torque_outputs_last_index} ${torque_outputs_per_command})
list(SUBLIST torque_outputs_full ${start} ${torque_outputs_per_command} torque_outputs_full_sublist)

add_custom_command(
COMMAND
${CMAKE_COMMAND} -E touch ${torque_outputs_full_sublist}
DEPENDS
torque
${torque_dirs}
${torque_files_abs}
OUTPUT
${torque_outputs_full_sublist}
)
endforeach()

else()

add_custom_command(
COMMAND
torque
-o ${PROJECT_BINARY_DIR}/torque-generated
-v8-root ${PROJECT_SOURCE_DIR}/v8
${torque_files}
COMMAND
${CMAKE_COMMAND} -E touch ${torque-outputs} ${torque_outputs}
DEPENDS
torque
${torque_dirs}
${torque_files_abs}
OUTPUT
${torque-outputs}
${torque_outputs}
)

endif ()

add_custom_command(
COMMAND
${CMAKE_COMMAND} -E make_directory ${torque_dirs}
Expand Down