[Openmp-commits] [PATCH] D134275: [OpenMP] [OMPD] Build gdb-plugin code only when python3 development files are available.

Vignesh Balasubramanian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Sep 20 05:22:59 PDT 2022


Vigneshbalu created this revision.
Vigneshbalu added reviewers: mgorny, aaronpuchert.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
Vigneshbalu requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

This is follow-up patch to the review https://reviews.llvm.org/D100185.

gdb-plugin code is a interface between gdb, libompd, gdb and libomp. and Python3 development files are required to build this utility.
This patch will disable the plugin code build when python3 dev files are not available.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134275

Files:
  openmp/libompd/CMakeLists.txt
  openmp/libompd/gdb-plugin/CMakeLists.txt


Index: openmp/libompd/gdb-plugin/CMakeLists.txt
===================================================================
--- openmp/libompd/gdb-plugin/CMakeLists.txt
+++ openmp/libompd/gdb-plugin/CMakeLists.txt
@@ -14,7 +14,6 @@
 )
 
 find_package (Python3 COMPONENTS Interpreter Development)
-find_package (PythonLibs REQUIRED)
 
 include_directories (${OMPD_INCLUDE_PATH})
 include_directories (${LIBOMP_INCLUDE_DIR})
Index: openmp/libompd/CMakeLists.txt
===================================================================
--- openmp/libompd/CMakeLists.txt
+++ openmp/libompd/CMakeLists.txt
@@ -8,10 +8,19 @@
 #//===----------------------------------------------------------------------===//
 #
 
+set(LIBOMP_OMPD_GDB_SUPPORT FALSE CACHE BOOL
+        "Build gdb-plugin code that enables OMPD support in GDB.")
+
+find_package (Python3 COMPONENTS Interpreter Development)
+if (Python3_INCLUDE_DIRS AND Python3_LIBRARIES)
+    set(LIBOMP_OMPD_GDB_SUPPORT TRUE)
+endif()
+
+
 if(LIBOMP_OMPD_SUPPORT)
     set(OMPD_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/src/)
     add_subdirectory(src)
-    if(NOT DISABLE_OMPD_GDB_PLUGIN)
+    if(LIBOMP_OMPD_GDB_SUPPORT)
         add_subdirectory(gdb-plugin)
     endif()
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134275.461538.patch
Type: text/x-patch
Size: 1213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220920/ce082cc7/attachment.bin>


More information about the Openmp-commits mailing list