Skip to content

Commit 18a18b2

Browse files
committed
Fix standalone clang builds after fb80b6b.
When clang is built against a prebuilt LLVM, LLVM_SOURCE_DIR is empty, which due to a cmake quirk caused list lengths to get out of sync. Add a workaround.
1 parent 9d9b8a2 commit 18a18b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,9 +1484,14 @@ function(configure_lit_site_cfg site_in site_out)
14841484

14851485
if (ARG_PATHS)
14861486
# Walk ARG_PATHS and collect the current value of the variables in there.
1487+
# list(APPEND) ignores empty elements exactly if the list is empty,
1488+
# so start the list with a dummy element and drop it, to make sure that
1489+
# even empty values make it into the values list.
1490+
set(ARG_PATH_VALUES "dummy")
14871491
foreach(path ${ARG_PATHS})
14881492
list(APPEND ARG_PATH_VALUES "${${path}}")
14891493
endforeach()
1494+
list(REMOVE_AT ARG_PATH_VALUES 0)
14901495

14911496
# Compute paths relative to the directory containing output lit.site.cfg.py.
14921497
# Passing ARG_PATH_VALUES as-is to execute_process() makes cmake strip

0 commit comments

Comments
 (0)