mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
The FASTBuild generator puts source files from different subdirectories into different `FastbuildObjectListNode` instances. This ensures that files with the same name will not write to the same object file. A unity bucket can only contain files from a single `FastbuildObjectListNode` instance, so a side effect of this logic is that unity buckets can only contain files in the same subdirectory. This change fixes the problem by skipping the subdirectory check logic for files with unity enabled. Fixes: #27457
24 lines
477 B
CMake
24 lines
477 B
CMake
# Verify that files from different subdirectories are combined into a single Unity node.
|
|
|
|
set(REGEX_TO_MATCH "
|
|
Unity\\('main_Unity_1'\\)
|
|
{
|
|
\\.UnityOutputPath = 'CMakeFiles/main.dir'
|
|
\\.UnityOutputPattern = 'main_Unity_1.cpp'
|
|
\\.UnityInputFiles =
|
|
{
|
|
.*main.cpp',
|
|
.*subdir1/file1.cpp',
|
|
.*subdir2/file2.cpp'
|
|
}
|
|
}
|
|
.*ObjectList.*
|
|
.*
|
|
.CompilerInputUnity =
|
|
{
|
|
'main_Unity_1'
|
|
}
|
|
")
|
|
|
|
include(${RunCMake_SOURCE_DIR}/check.cmake)
|