This commit is contained in:
2025-11-28 23:13:44 +05:30
commit a3a8e79709
7360 changed files with 1156074 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# A simple wrapper around configure_file to try to make it multi-thread safe with a file lock.
FUNCTION(Configure_File_MT IN_TEMPLATE OUTPUT_FILENAME)
FILE(LOCK ${OUTPUT_FILENAME}.lock
GUARD FUNCTION
RESULT_VARIABLE LOCK_RESULT
TIMEOUT 30)
IF (NOT LOCK_RESULT EQUAL 0)
MESSAGE(WARNING "Failed to lock file ${OUTPUT_FILENAME} for output ERROR: ${LOCK_RESULT}")
return()
ENDIF()
CONFIGURE_FILE("${IN_TEMPLATE}" "${OUTPUT_FILENAME}" @ONLY)
FILE(LOCK ${OUTPUT_FILENAME}.lock RELEASE)
ENDFUNCTION()