diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3321d9cd82..119e15adae 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -486,6 +486,11 @@ jobs: - name: macOS-framework build-framework: ON steps: + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + architecture: 'x64' - uses: actions/checkout@v4 with: submodules: recursive @@ -540,6 +545,11 @@ jobs: platform: SIMULATOR64 sdk: iphonesimulator steps: + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + architecture: 'x64' - uses: actions/checkout@v4 with: submodules: recursive diff --git a/third_party/mavlink/CMakeLists.txt b/third_party/mavlink/CMakeLists.txt index 18759d7137..3083a8a2ed 100644 --- a/third_party/mavlink/CMakeLists.txt +++ b/third_party/mavlink/CMakeLists.txt @@ -11,9 +11,18 @@ list(APPEND CMAKE_ARGS "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" ) -# Without this GitHub actions picks the wrong python3 executable. +if (POLICY CMP0094) + cmake_policy(SET CMP0094 NEW) # FindPython should return the first matching Python +endif () + +# Needed to find the right Python on macOS +if (NOT DEFINED Python_FIND_FRAMEWORK) + set(Python_FIND_FRAMEWORK "LAST") +endif() + +# Needed to find the right Python on Windows set(Python3_FIND_REGISTRY "NEVER") -set(Python3_FIND_FRAMEWORK "NEVER") + find_package(Python3 COMPONENTS Interpreter REQUIRED) ExternalProject_add(