[Openmp-commits] [openmp] 97bb709 - [OpenMP] [OMPD] Build gdb-plugin code only when python3 development files are available.

Vignesh Balasubramanian via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 7 02:06:35 PDT 2022


Author: Vignesh Balasubramanian
Date: 2022-10-07T14:35:56+05:30
New Revision: 97bb709013a2d9a75fccce41175efd4db486ac89

URL: https://github.com/llvm/llvm-project/commit/97bb709013a2d9a75fccce41175efd4db486ac89
DIFF: https://github.com/llvm/llvm-project/commit/97bb709013a2d9a75fccce41175efd4db486ac89.diff

LOG: [OpenMP] [OMPD] Build gdb-plugin code only when python3 development files are available.

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

Reviewed By: @mgorny, @aaronpuchert
Differential Revision: https://reviews.llvm.org/D134275

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/openmp/libompd/CMakeLists.txt b/openmp/libompd/CMakeLists.txt
index aac5b67c97468..7720af1cb237d 100644
--- a/openmp/libompd/CMakeLists.txt
+++ b/openmp/libompd/CMakeLists.txt
@@ -8,10 +8,13 @@
 #//===----------------------------------------------------------------------===//
 #
 
+find_package (Python3 COMPONENTS Interpreter Development)
+option(LIBOMP_OMPD_GDB_SUPPORT "Build gdb-plugin code that enables OMPD support in GDB." ${Python3_FOUND})
+
 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()

diff  --git a/openmp/libompd/gdb-plugin/CMakeLists.txt b/openmp/libompd/gdb-plugin/CMakeLists.txt
index 06726a9f1fe37..a60f9419db191 100644
--- a/openmp/libompd/gdb-plugin/CMakeLists.txt
+++ b/openmp/libompd/gdb-plugin/CMakeLists.txt
@@ -13,9 +13,6 @@ set (CMAKE_MODULE_PATH
     ${CMAKE_MODULE_PATH}
 )
 
-find_package (Python3 COMPONENTS Interpreter Development)
-find_package (PythonLibs REQUIRED)
-
 include_directories (${OMPD_INCLUDE_PATH})
 include_directories (${LIBOMP_INCLUDE_DIR})
 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python-module/ompd/__init__.py


        


More information about the Openmp-commits mailing list