From 5a6de9a9016b81715ffe63aa0e7a335be621f6a9 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Wed, 21 Feb 2024 23:22:52 +0100 Subject: [PATCH] ci: Fix build --- .github/workflows/github-actions.yml | 1 + dbus/CMakeLists.txt | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 5052198d..61eefb75 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -26,6 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - run: sudo apt install libbluetooth-dev - run: ./ci/generate-python-package.sh - name: Archive Python packages uses: actions/upload-artifact@v4 diff --git a/dbus/CMakeLists.txt b/dbus/CMakeLists.txt index aa953804..4592bd71 100644 --- a/dbus/CMakeLists.txt +++ b/dbus/CMakeLists.txt @@ -102,15 +102,18 @@ if(GATTLIB_PYTHON_INTERFACE) else() set(Python_USE_STATIC_LIBS TRUE) endif() - find_package(Python COMPONENTS Development.Module) - if (Python_Development.Module_FOUND) - include_directories(${Python_INCLUDE_DIRS}) - list(APPEND gattlib_LIBS ${Python_LIBRARIES}) - - add_definitions(-DWITH_PYTHON -DPYTHON_VERSION_MAJOR=${Python_VERSION_MAJOR} -DPYTHON_VERSION_MINOR=${Python_VERSION_MINOR}) - else() - message(FATAL_ERROR "Could not find Python developer package") + find_package(Python COMPONENTS Interpreter Development) + if (NOT Python_Development_FOUND) + find_package(Python COMPONENTS Development.Module) + if (NOT Python_Development.Module_FOUND) + message(FATAL_ERROR "Could not find Python developer package") + endif() endif() + + include_directories(${Python_INCLUDE_DIRS}) + list(APPEND gattlib_LIBS ${Python_LIBRARIES}) + + add_definitions(-DWITH_PYTHON -DPYTHON_VERSION_MAJOR=${Python_VERSION_MAJOR} -DPYTHON_VERSION_MINOR=${Python_VERSION_MINOR}) endif() # Gattlib