[Openmp-commits] [openmp] [OpenMP] [cmake] In standalone mode, make Python3_EXECUTABLE available (PR #80828)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 6 04:46:59 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-openmp

Author: Martin Storsjö (mstorsjo)

<details>
<summary>Changes</summary>

When running the tests, we try to invoke them as
"${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE}", but when running "find_package(Python3)" within the function "find_standalone_test_dependencies", the variable "Python3_EXECUTABLE" only gets set within the function scope.

Tests have worked regardless of this in many cases, where executing the python script directly succeeds. But for consistency, and for working in cases when the python script can't be executed as such, make the Python3_EXECUTABLE variable available as intended.

---
Full diff: https://github.com/llvm/llvm-project/pull/80828.diff


1 Files Affected:

- (modified) openmp/cmake/OpenMPTesting.cmake (+2) 


``````````diff
diff --git a/openmp/cmake/OpenMPTesting.cmake b/openmp/cmake/OpenMPTesting.cmake
index df41956dadd4f..ab2348ae59b5f 100644
--- a/openmp/cmake/OpenMPTesting.cmake
+++ b/openmp/cmake/OpenMPTesting.cmake
@@ -10,6 +10,8 @@ function(find_standalone_test_dependencies)
     message(WARNING "The check targets will not be available!")
     set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
     return()
+  else()
+    set(Python3_EXECUTABLE ${Python3_EXECUTABLE} PARENT_SCOPE)
   endif()
 
   # Find executables.

``````````

</details>


https://github.com/llvm/llvm-project/pull/80828


More information about the Openmp-commits mailing list