diff --git a/.github/workflows/main.workflow.yml b/.github/workflows/main.workflow.yml index 94abd4b6b0..4e2ac21546 100644 --- a/.github/workflows/main.workflow.yml +++ b/.github/workflows/main.workflow.yml @@ -139,7 +139,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2022, ubuntu-latest] + os: [macos-latest, windows-2025, ubuntu-latest] cmake: ['3.22.x', '4.0.x'] steps: @@ -164,14 +164,20 @@ jobs: sudo apt-get install libopencv-dev libudev-dev libusb-1.0-0-dev - name: Install dependencies - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: | choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + - name: Configure MSVC environment + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + - name: Build run: | - cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON ${{ env.CMAKE_ARGS }} + cmake -S . -B build ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D CMAKE_BUILD_TYPE=Release -D DEPTHAI_BUILD_EXAMPLES=ON -D DEPTHAI_BUILD_TESTS=ON ${{ env.CMAKE_ARGS }} cmake --build build --parallel 4 --config Release integration: @@ -180,7 +186,7 @@ jobs: if: needs.precheck.outputs.should_run == 'true' strategy: matrix: - os: [macos-latest, windows-2022, ubuntu-latest] + os: [macos-latest, windows-2025, ubuntu-latest] build-type: [Debug, Release] # shared: [true, false] shared: [true] @@ -212,12 +218,16 @@ jobs: sudo apt-get install libopencv-dev libudev-dev libusb-1.0-0-dev - name: Install dependencies - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: | choco install opencv echo "OpenCV_DIR=C:\tools\opencv\build" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CMAKE_GENERATOR=Visual Studio 17 2022" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - echo "CMAKE_GENERATOR_PLATFORM=${{ matrix.platform }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Configure MSVC environment + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.13 @@ -225,17 +235,17 @@ jobs: cmake-version: '3.29.x' - name: Configure ${{ matrix.build-type }}, shared ${{ matrix.shared }}, ${{ matrix.platform }} - run: cmake -S . -B build -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }} + run: cmake -S . -B build ${{ runner.os == 'Windows' && '-G Ninja' || '' }} -D BUILD_SHARED_LIBS=${{ matrix.shared}} -D CMAKE_BUILD_TYPE=${{ matrix.build-type }} -D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/depthai_install ${{ env.CMAKE_ARGS }} - name: Set path to shared library dll (Windows) - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' run: echo "$GITHUB_WORKSPACE/depthai_install/bin/" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Build and install run: cmake --build build --config ${{ matrix.build-type }} --target install --parallel 4 - name: Upload Win64 shared library - if: matrix.os == 'windows-2022' && matrix.shared && matrix.platform == 'x64' + if: runner.os == 'Windows' && matrix.shared && matrix.platform == 'x64' uses: actions/upload-artifact@v4 with: name: windows-prebuilt-win64-${{ matrix.build-type }} diff --git a/.github/workflows/python-main.yml b/.github/workflows/python-main.yml index e4eebb0b32..a2d4a77192 100644 --- a/.github/workflows/python-main.yml +++ b/.github/workflows/python-main.yml @@ -24,7 +24,7 @@ on: ################################### env: - CMAKE_WINDOWS_SDK_VERSION: '10.0.18362.0' + CMAKE_WINDOWS_SDK_VERSION: '10.0.26100.0' # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -127,7 +127,7 @@ jobs: VCPKG_BINARY_SOURCES: "clear;files,/home/runner/.vcpkg,readwrite" strategy: matrix: - # os: [ubuntu-latest, windows-2022, macos-latest] + # os: [ubuntu-latest, windows-2025, macos-latest] os: [ubuntu-latest] # TODO(Morato) - re-enable windows & macos runs-on: ${{ matrix.os }} steps: @@ -139,13 +139,13 @@ jobs: run: echo Home directory inside container $HOME - name: Cache vcpkg folder - if: matrix.os != 'windows-2022' + if: runner.os != 'Windows' uses: actions/cache@v3 with: path: /home/runner/.vcpkg/ key: vcpkg-${{ matrix.os }} - name: Cache vcpkg folder - if: matrix.os == 'windows-2022' + if: runner.os == 'Windows' uses: actions/cache@v3 with: path: C:/.vcpkg/ @@ -217,7 +217,7 @@ jobs: # This job builds wheels for Windows x86_64 arch build-windows-x86_64: needs: build-docstrings - runs-on: windows-2022 + runs-on: windows-2025 strategy: matrix: python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] @@ -238,7 +238,7 @@ jobs: uses: actions/cache@v3 with: path: C:/.vcpkg - key: vcpkg-windows-2022 + key: vcpkg-windows-2025 - uses: actions/checkout@v3 with: submodules: 'recursive' @@ -665,7 +665,7 @@ jobs: combine-windows-x86_64-wheels: needs: build-windows-x86_64 - runs-on: windows-2022 + runs-on: windows-2025 steps: - uses: actions/checkout@v3 - name: Download audited wheels diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 3e4d526297..f44c2d0165 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -3,6 +3,7 @@ import sys import platform import subprocess +import shlex import find_version from setuptools import setup, Extension @@ -207,7 +208,7 @@ def build_extension(self, ext): # Add additional cmake build args from environment if 'CMAKE_BUILD_ARGS' in os.environ: - build_args += [os.environ['CMAKE_BUILD_ARGS']] + build_args += shlex.split(os.environ['CMAKE_BUILD_ARGS']) # Windows if platform.system() == "Windows": @@ -255,7 +256,7 @@ def build_extension(self, ext): # Add additional cmake args from environment if 'CMAKE_ARGS' in os.environ: - cmake_args += [os.environ['CMAKE_ARGS']] + cmake_args += shlex.split(os.environ['CMAKE_ARGS']) if not os.path.exists(self.build_temp): os.makedirs(self.build_temp)