data_to_c: CMake: Speed-up data_to_c

This moves the logic to create the parent folder to data_to_c itself
rather than having cmake do it, preventing several thousand cmake instances
to be started.

see pr#141404 for details/benchmarks

Pull Request: https://projects.blender.org/blender/blender/pulls/141404
This commit is contained in:
Ray Molenkamp
2025-07-15 02:08:14 +02:00
committed by Ray molenkamp
parent 32a6e14d41
commit 097531ccbf
2 changed files with 15 additions and 3 deletions

View File

@@ -999,7 +999,6 @@ function(data_to_c
add_custom_command(
OUTPUT ${file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND "$<TARGET_FILE:datatoc>" ${file_from} ${file_to}
DEPENDS ${file_from} datatoc)
@@ -1026,7 +1025,6 @@ function(data_to_c_simple
add_custom_command(
OUTPUT ${_file_to}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND "$<TARGET_FILE:datatoc>" ${_file_from} ${_file_to}
DEPENDS ${_file_from} datatoc)
@@ -1055,7 +1053,6 @@ function(glsl_to_c
add_custom_command(
OUTPUT ${_file_to} ${_file_meta}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
COMMAND "$<TARGET_FILE:glsl_preprocess>" ${_file_from} ${_file_tmp} ${_file_meta}
COMMAND "$<TARGET_FILE:datatoc>" ${_file_tmp} ${_file_to}
DEPENDS ${_file_from} datatoc glsl_preprocess)