aboutsummaryrefslogtreecommitdiff
path: root/llvm/cmake/modules/FileLock.cmake
blob: 1e403a625847e39732fdaecfca44fcf7d8358603 (plain)
1
2
3
4
5
6
7
8
9
# CMake script that synchronizes process execution on a given file lock.
#
# Input variables:
#   LOCK_FILE_PATH    - The file to be locked for the scope of the process of this cmake script.
#   COMMAND           - The command to be executed.

file(LOCK ${LOCK_FILE_PATH})
string(REPLACE "@" ";" command_args ${COMMAND})
execute_process(COMMAND ${command_args} COMMAND_ERROR_IS_FATAL ANY)