Skip to content

Commit cd2bfb1

Browse files
committedSep 19, 2016
Fix respecting LIBOMP_LLVM_LIT_EXECUTABLE as full path
Fix lit search to correctly respect LIBOMP_LLVM_LIT_EXECUTABLE as full program path. The variable passed to find_program() is created by CMake as a cache variable, and therefore can be directly overriden by the user. Since this was the design of LIBOMP_LLVM_LIT_EXECUTABLE (as can be deduced from the error messages) and there is no other use of LIT_EXECUTABLE, remove the redundant variable and pass LIBOMP_LLVM_LIT_EXECUTABLE directly to find_program(). Furthermore, the previous code did not work since the HINTS argument specifies more search directories rather than expected full path. Quoting the CMake documentation: > 3. Search the paths specified by the HINTS option. These should be > paths computed by system introspection, such as a hint provided by > the location of another item already found. Hard-coded guesses should > be specified with the PATHS option. Differential Revision: https://reviews.llvm.org/D24710 llvm-svn: 281887
1 parent 88b9316 commit cd2bfb1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed
 

‎openmp/runtime/test/CMakeLists.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,10 @@ if(${LIBOMP_STANDALONE_BUILD})
4040
"Compiler to use for testing OpenMP library")
4141
set(LIBOMP_TEST_OPENMP_FLAG -fopenmp CACHE STRING
4242
"OpenMP compiler flag to use for testing OpenMP library")
43-
set(LIBOMP_LLVM_LIT_EXECUTABLE "" CACHE STRING
44-
"Path to llvm-lit")
45-
find_program(LIT_EXECUTABLE
43+
find_program(LIBOMP_LLVM_LIT_EXECUTABLE
4644
NAMES llvm-lit lit.py
47-
HINTS ${LIBOMP_LLVM_LIT_EXECUTABLE}
4845
PATHS ${OPENMP_LLVM_TOOLS_DIR})
49-
if(NOT LIT_EXECUTABLE)
46+
if(NOT LIBOMP_LLVM_LIT_EXECUTABLE)
5047
libomp_say("Cannot find llvm-lit.")
5148
libomp_say("Please put llvm-lit in your PATH, set LIBOMP_LLVM_LIT_EXECUTABLE to its full path or point OPENMP_LLVM_TOOLS_DIR to its directory")
5249
libomp_warning_say("The check-libomp target will not be available!")
@@ -71,7 +68,7 @@ if(${LIBOMP_STANDALONE_BUILD})
7168
"Default options for lit")
7269
separate_arguments(LIBOMP_LIT_ARGS)
7370
add_custom_target(check-libomp
74-
COMMAND ${PYTHON_EXECUTABLE} ${LIT_EXECUTABLE} ${LIBOMP_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
71+
COMMAND ${PYTHON_EXECUTABLE} ${LIBOMP_LLVM_LIT_EXECUTABLE} ${LIBOMP_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
7572
DEPENDS omp
7673
COMMENT "Running libomp tests"
7774
${cmake_3_2_USES_TERMINAL}

0 commit comments

Comments
 (0)
Please sign in to comment.