Change: When building NewGRFs, use grfid (from grfcodec) to calculate NewGRF MD5 hash. (#11492)

This allows for v2 container NewGRFs to be created. Hashes are needed for building the baseset metadata, so the .hash files are stored the source tree so they can be built if grfcodec and grfid are not present.

The hash of openttd.grf is not actually needed, but it is simpler to leave it in than handle only orig_extra.grf.
This commit is contained in:
2023-11-26 15:59:41 +00:00
committed by GitHub
parent c5a292c0df
commit 872fdcbbab
7 changed files with 23 additions and 2 deletions

View File

@@ -28,12 +28,13 @@ function(create_grf_command)
list(APPEND GRF_PNG_BINARY_FILES ${GRF_PNG_BINARY_FILE})
endforeach()
add_custom_command(OUTPUT ${GRF_BINARY_FILE}
add_custom_command(OUTPUT ${GRF_BINARY_FILE} ${GRF_BINARY_FILE}.hash
COMMAND ${CMAKE_COMMAND}
-DGRF_SOURCE_FOLDER=${CMAKE_CURRENT_SOURCE_DIR}
-DGRF_BINARY_FILE=${GRF_BINARY_FILE}
-DNFORENUM_EXECUTABLE=${NFORENUM_EXECUTABLE}
-DGRFCODEC_EXECUTABLE=${GRFCODEC_EXECUTABLE}
-DGRFID_EXECUTABLE=${GRFID_EXECUTABLE}
-P ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/cmake/scripts/CreateGRF.cmake
DEPENDS ${GRF_PNG_BINARY_FILES}