[Openmp-commits] [openmp] r281887 - Fix respecting LIBOMP_LLVM_LIT_EXECUTABLE as full path

Michal Gorny via Openmp-commits openmp-commits at lists.llvm.org
Sun Sep 18 23:55:56 PDT 2016


Author: mgorny
Date: Mon Sep 19 01:55:56 2016
New Revision: 281887

URL: http://llvm.org/viewvc/llvm-project?rev=281887&view=rev
Log:
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

Modified:
    openmp/trunk/runtime/test/CMakeLists.txt

Modified: openmp/trunk/runtime/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/CMakeLists.txt?rev=281887&r1=281886&r2=281887&view=diff
==============================================================================
--- openmp/trunk/runtime/test/CMakeLists.txt (original)
+++ openmp/trunk/runtime/test/CMakeLists.txt Mon Sep 19 01:55:56 2016
@@ -40,13 +40,10 @@ if(${LIBOMP_STANDALONE_BUILD})
     "Compiler to use for testing OpenMP library")
   set(LIBOMP_TEST_OPENMP_FLAG -fopenmp CACHE STRING
     "OpenMP compiler flag to use for testing OpenMP library")
-  set(LIBOMP_LLVM_LIT_EXECUTABLE "" CACHE STRING
-    "Path to llvm-lit")
-  find_program(LIT_EXECUTABLE
+  find_program(LIBOMP_LLVM_LIT_EXECUTABLE
     NAMES llvm-lit lit.py
-    HINTS ${LIBOMP_LLVM_LIT_EXECUTABLE}
     PATHS ${OPENMP_LLVM_TOOLS_DIR})
-  if(NOT LIT_EXECUTABLE)
+  if(NOT LIBOMP_LLVM_LIT_EXECUTABLE)
     libomp_say("Cannot find llvm-lit.")
     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")
     libomp_warning_say("The check-libomp target will not be available!")
@@ -71,7 +68,7 @@ if(${LIBOMP_STANDALONE_BUILD})
     "Default options for lit")
   separate_arguments(LIBOMP_LIT_ARGS)
   add_custom_target(check-libomp
-    COMMAND ${PYTHON_EXECUTABLE} ${LIT_EXECUTABLE} ${LIBOMP_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
+    COMMAND ${PYTHON_EXECUTABLE} ${LIBOMP_LLVM_LIT_EXECUTABLE} ${LIBOMP_LIT_ARGS} ${CMAKE_CURRENT_BINARY_DIR}
     DEPENDS omp
     COMMENT "Running libomp tests"
     ${cmake_3_2_USES_TERMINAL}




More information about the Openmp-commits mailing list