xref: /llvm-project/llvm/cmake/modules/FileLock.cmake (revision 6655c53ff02f0ffca0fcaa3261e14c2a6417d3da)
1# CMake script that synchronizes process execution on a given file lock.
2#
3# Input variables:
4#   LOCK_FILE_PATH    - The file to be locked for the scope of the process of this cmake script.
5#   COMMAND           - The command to be executed.
6
7file(LOCK ${LOCK_FILE_PATH})
8string(REPLACE "@" ";" command_args ${COMMAND})
9execute_process(COMMAND ${command_args} COMMAND_ERROR_IS_FATAL ANY)
10