Files
cmake/Tests/RunCMake/file/lock_script_example.cmake
Ruslan Baratov 638069631d file: Fix LOCK command handling in scripts and includes
Move lock scope handling to the `FileScopeBase` class to cover:

- `IncludeScope` for `include()`
- `ListFileScope` for `cmake -P` script mode
- `BuildsystemFileScope` for `CMakeLists.txt`/`add_subdirectory`

Fixes: #16480
2026-05-21 10:14:26 +08:00

3 lines
90 B
CMake

file(LOCK "${FILE_TO_LOCK}" GUARD FILE TIMEOUT 0)
message(STATUS "File locked in script")