Skip to content

Commit 5e65ffc

Browse files
committed
[Comgr] Allow users to pass LLVM_LIT_PATH to CMake
Some builds/installations have a directory setup such that we cannot deduce the path to LLVM build directory from the Comgr build directory. In these cases, a user can manually pass the path to the LLVM_LIT script to CMake via -DLLVM_LIT_PATH Change-Id: I9a31ef401602469a7efb6a316807e5f5c0cdb743
1 parent f26e346 commit 5e65ffc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

amd/comgr/test-lit/CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ cannonicalize_cmake_boolean(COMGR_DISABLE_SPIRV)
1010

1111
configure_file(lit.site.cfg.py.in lit.site.cfg.py @ONLY)
1212

13-
# Comgr source build
14-
if (EXISTS "${LLVM_TOOLS_BINARY_DIR}/../../bin/llvm-lit")
15-
set(LLVM_LIT_PATH "${LLVM_TOOLS_BINARY_DIR}/../../bin/llvm-lit")
16-
# LLVM external projects build
17-
else()
18-
set(LLVM_LIT_PATH "${LLVM_TOOLS_BINARY_DIR}/llvm-lit")
13+
if (NOT DEFINED LLVM_LIT_PATH)
14+
# Comgr source build
15+
if (EXISTS "${LLVM_TOOLS_BINARY_DIR}/../../bin/llvm-lit")
16+
set(LLVM_LIT_PATH "${LLVM_TOOLS_BINARY_DIR}/../../bin/llvm-lit")
17+
# LLVM external projects build
18+
else()
19+
set(LLVM_LIT_PATH "${LLVM_TOOLS_BINARY_DIR}/llvm-lit")
20+
endif()
1921
endif()
2022

2123
add_custom_target(test-lit COMMAND "${LLVM_LIT_PATH}"

0 commit comments

Comments
 (0)