From 08fdc1b3f94e144a30a71463ccf2c961d2328fcf Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 20 Oct 2026 13:07:36 +0800 Subject: [PATCH 1/4] Add Ubuntu 26.04, VS2026 and WebAssembly64 release packages --- .github/workflows/release.yml | 93 +++++++++++++++++------- README.md | 49 +++++++++++-- patches/opencv-2.4.13.7-newer-msvc.patch | 8 +- patches/opencv-3.4.20-newer-msvc.patch | 30 +++++++- test/CMakeLists.txt | 5 ++ test/main.cpp | 4 + 6 files changed, 155 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01fb5071..88538c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,12 @@ name: release -#on: pull_request on: + pull_request: + paths: + - ".github/workflows/release.yml" + - "patches/**" + - "highgui/**" + - "test/**" + - "opencv*_cmake_options.txt" push: tags: - '*' @@ -16,7 +22,7 @@ env: ENABLE_BITCODE: OFF ENABLE_ARC: OFF ENABLE_VISIBILITY: OFF - EMSCRIPTEN_VERSION: 3.1.28 + EMSCRIPTEN_VERSION: 6.0.12 permissions: contents: read @@ -355,6 +361,7 @@ jobs: path: opencv-mobile-5.0.0.zip android: + if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -458,6 +465,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip harmonyos: + if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -557,6 +565,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip ios: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -645,6 +654,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip ios-simulator: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -743,6 +753,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip armlinux: + if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -841,6 +852,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip macos: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -943,6 +955,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip mac-catalyst: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1041,6 +1054,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip watchos: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1126,6 +1140,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip watchos-simulator: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1224,6 +1239,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip tvos: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1328,6 +1344,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip tvos-simulator: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1426,6 +1443,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip visionos: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1514,6 +1532,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip visionos-simulator: + if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1623,6 +1642,7 @@ jobs: - { msvc-version: vs2017, windows-version: 2022, toolset-version: v141, windows-sdk-version: 22621 } - { msvc-version: vs2019, windows-version: 2022, toolset-version: v142, windows-sdk-version: 22621 } - { msvc-version: vs2022, windows-version: 2022, toolset-version: v143, windows-sdk-version: 26100 } + - { msvc-version: vs2026, windows-version: 2025-vs2026, toolset-version: v145, windows-sdk-version: 26100 } include: - opencv-version: 5.0.0 os-compiler: @@ -1636,10 +1656,16 @@ jobs: windows-version: 2022 toolset-version: v143 windows-sdk-version: 26100 + - opencv-version: 5.0.0 + os-compiler: + msvc-version: vs2026 + windows-version: 2025-vs2026 + toolset-version: v145 + windows-sdk-version: 26100 runs-on: windows-${{ matrix.os-compiler.windows-version }} env: UseMultiToolTask: true - COMMON_CMAKE_OPTIONS: -T ${{ matrix.os-compiler.toolset-version }},host=x64 -DCMAKE_INSTALL_PREFIX=install + COMMON_CMAKE_OPTIONS: -G "${{ matrix.os-compiler.msvc-version == 'vs2026' && 'Visual Studio 18 2026' || 'Visual Studio 17 2022' }}" -T ${{ matrix.os-compiler.toolset-version }},host=x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=install steps: - uses: actions/checkout@v7 - uses: actions/download-artifact@v8 @@ -1690,7 +1716,7 @@ jobs: cmake --build . --config Release -j 4 cmake --build . --config Release --target install - name: build-arm64 - if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' + if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' || matrix.os-compiler.msvc-version == 'vs2026' run: | cd ${{ env.SOURCE_DIR }} mkdir build-arm64; cd build-arm64 @@ -1707,7 +1733,7 @@ jobs: Copy-Item -Verbose -Recurse -Path "${{ env.SOURCE_DIR }}\build-x64\install\*" -Destination "${{ env.PACKAGE_NAME }}\x64" 7z a -r ${{ env.PACKAGE_NAME }}.zip ${{ env.PACKAGE_NAME }} - name: package - if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' + if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' || matrix.os-compiler.msvc-version == 'vs2026' run: | mkdir ${{ env.PACKAGE_NAME }} mkdir ${{ env.PACKAGE_NAME }}/x86 @@ -1730,7 +1756,7 @@ jobs: cmake ${{ env.COMMON_CMAKE_OPTIONS }} -A x64,version=10.0.${{ matrix.os-compiler.windows-sdk-version }}.0 -DOpenCV_DIR="$env:GITHUB_WORKSPACE\${{ env.PACKAGE_NAME }}\x64" -DOpenCV_STATIC=ON .. cmake --build . --config Release -j 4 - name: test-arm64 - if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' + if: matrix.os-compiler.msvc-version == 'vs2019' || matrix.os-compiler.msvc-version == 'vs2022' || matrix.os-compiler.msvc-version == 'vs2026' run: | cd test mkdir build-arm64; cd build-arm64 @@ -1752,9 +1778,10 @@ jobs: os-ubuntu: - { ubuntu-id: 2204, ubuntu-version: 22.04 } - { ubuntu-id: 2404, ubuntu-version: 24.04 } + - { ubuntu-id: 2604, ubuntu-version: 26.04 } runs-on: ubuntu-${{ matrix.os-ubuntu.ubuntu-version }} env: - COMMON_CMAKE_OPTIONS: -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release + COMMON_CMAKE_OPTIONS: -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release steps: - uses: actions/checkout@v7 - uses: actions/download-artifact@v8 @@ -1802,14 +1829,20 @@ jobs: webassembly: needs: [setup] + name: "${{ matrix.arch.name }} (${{ matrix.opencv-version }})" runs-on: ubuntu-latest strategy: fail-fast: false matrix: opencv-version: [2.4.13.7, 3.4.20, 4.14.0, 5.0.0] + arch: + - { name: webassembly, flags: "", pointer-size: 4 } + - { name: webassembly64, flags: "-m64", pointer-size: 8 } env: COMMON_CMAKE_OPTIONS: | - -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \ + -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.arch.flags }}" \ -DCMAKE_INSTALL_PREFIX=install \ -DCMAKE_BUILD_TYPE=Release \ steps: @@ -1827,7 +1860,7 @@ jobs: run: | unzip -q opencv-mobile-${{ matrix.opencv-version }}.zip echo "SOURCE_DIR=opencv-mobile-${{ matrix.opencv-version }}" >> $GITHUB_ENV - echo "PACKAGE_NAME=opencv-mobile-${{ matrix.opencv-version }}-webassembly" >> $GITHUB_ENV + echo "PACKAGE_NAME=opencv-mobile-${{ matrix.opencv-version }}-${{ matrix.arch.name }}" >> $GITHUB_ENV - name: build run: | source emsdk/emsdk_env.sh @@ -1836,8 +1869,8 @@ jobs: mkdir build && cd build cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=OFF -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install @@ -1848,8 +1881,8 @@ jobs: mkdir build-simd && cd build-simd cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=OFF -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0 -msimd128" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0 -msimd128" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install @@ -1861,8 +1894,8 @@ jobs: mkdir build-threads && cd build-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=ON -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install @@ -1873,8 +1906,8 @@ jobs: mkdir build-simd-threads && cd build-simd-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=ON -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -msimd128" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -msimd128" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install @@ -1899,38 +1932,46 @@ jobs: run: echo "OPENCV_SUBDIR=lib/cmake/opencv5" >> $GITHUB_ENV - name: test run: | + source emsdk/emsdk_env.sh cd test mkdir build && cd build cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ + -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/basic/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-simd run: | + source emsdk/emsdk_env.sh cd test mkdir build-simd && cd build-simd cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0 -msimd128" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=0 -msimd128" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ + -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/simd/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-threads run: | + source emsdk/emsdk_env.sh cd test mkdir build-threads && cd build-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ + -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/threads/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-simd-threads run: | + source emsdk/emsdk_env.sh cd test mkdir build-simd-threads && cd build-simd-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCMAKE_C_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -msimd128" \ - -DCMAKE_CXX_FLAGS="-fno-rtti -fno-exceptions -s WASM=1 -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=4 -msimd128" \ + -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ + -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ + -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/simd-threads/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: upload @@ -1940,6 +1981,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip apple: + if: github.event_name != 'pull_request' needs: [macos, ios, ios-simulator, mac-catalyst, watchos, watchos-simulator, tvos, tvos-simulator, visionos, visionos-simulator] runs-on: macos-14 strategy: @@ -2045,6 +2087,7 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip devboard: + if: github.event_name != 'pull_request' needs: [setup] name: "devboard-${{ matrix.name }} (${{ matrix.opencv-version }})" runs-on: ubuntu-latest diff --git a/README.md b/README.md index 25687bcd..76104baf 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ https://github.com/nihui/opencv-mobile/releases/latest -OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 packages are provided for VS2019 and VS2022 only. +OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 packages are provided for VS2019, VS2022 and VS2026 only. @@ -229,7 +229,7 @@ OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 - @@ -251,11 +251,22 @@ OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.14.0-ubuntu-2404.zip) [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-ubuntu-2404.zip) + + + + + - @@ -299,12 +310,23 @@ OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 - + + + + + - + + + + + @@ -335,7 +368,9 @@ OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 * [KleidiCV](https://gitlab.arm.com/kleidi/kleidicv) HAL enabled for Android arm64-v8a, all Apple arm64/arm64e platforms and Linux aarch64 targets * iOS / MacOS / Mac-Catalyst / watchOS / tvOS / visionOS package build with Xcode 15.2 * ARM Linux package build with cross-compiler on Ubuntu-24.04 -* WebAssembly package build with Emscripten 3.1.28 +* Ubuntu packages build on Ubuntu-22.04, Ubuntu-24.04 and Ubuntu-26.04 respectively +* VS2026 package includes x86, x64 and arm64 builds +* WebAssembly (32-bit) and WebAssembly64 packages build with Emscripten 6.0.12; both include basic, simd, threads and simd-threads variants ### opencv-mobile package for development boards @@ -533,6 +568,8 @@ find_package(OpenCV REQUIRED) target_link_libraries(your_target ${OpenCV_LIBS}) ``` +For WebAssembly64, pass ```-m64``` when compiling and linking your application, and use a memory64-capable runtime. The existing WebAssembly package remains 32-bit. + # How-to-build your custom package We reduce the binary size of opencv-mobile in 3 ways diff --git a/patches/opencv-2.4.13.7-newer-msvc.patch b/patches/opencv-2.4.13.7-newer-msvc.patch index cbdffc7e..0b84918e 100644 --- a/patches/opencv-2.4.13.7-newer-msvc.patch +++ b/patches/opencv-2.4.13.7-newer-msvc.patch @@ -1,7 +1,7 @@ diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVConfig.cmake opencv-2.4.13.7/cmake/OpenCVConfig.cmake --- opencv-2.4.13.7.orig/cmake/OpenCVConfig.cmake 2018-07-02 20:41:56.000000000 +0800 +++ opencv-2.4.13.7/cmake/OpenCVConfig.cmake 2023-08-13 22:11:10.193931771 +0800 -@@ -85,6 +85,10 @@ elseif(MSVC) +@@ -85,6 +85,12 @@ elseif(MSVC) set(OpenCV_RUNTIME vc14) elseif(MSVC_VERSION MATCHES "^191[0-9]$") set(OpenCV_RUNTIME vc15) @@ -9,13 +9,15 @@ diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVConfig.cmake opencv-2.4.13.7/cmake/ + set(OpenCV_RUNTIME vc16) + elseif(MSVC_VERSION MATCHES "^19[34][0-9]$") + set(OpenCV_RUNTIME vc17) ++ elseif(MSVC_VERSION MATCHES "^195[0-9]$") ++ set(OpenCV_RUNTIME vc18) endif() elseif(MINGW) set(OpenCV_RUNTIME mingw) diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake --- opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake 2018-07-02 20:41:56.000000000 +0800 +++ opencv-2.4.13.7/cmake/OpenCVDetectCXXCompiler.cmake 2023-08-13 22:11:03.358965110 +0800 -@@ -104,6 +104,10 @@ elseif(MSVC) +@@ -104,6 +104,12 @@ elseif(MSVC) set(OpenCV_RUNTIME vc14) elseif(MSVC_VERSION MATCHES "^191[0-9]$") set(OpenCV_RUNTIME vc15) @@ -23,6 +25,8 @@ diff -Nuarp opencv-2.4.13.7.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-2.4. + set(OpenCV_RUNTIME vc16) + elseif(MSVC_VERSION MATCHES "^19[34][0-9]$") + set(OpenCV_RUNTIME vc17) ++ elseif(MSVC_VERSION MATCHES "^195[0-9]$") ++ set(OpenCV_RUNTIME vc18) endif() elseif(MINGW) set(OpenCV_RUNTIME mingw) diff --git a/patches/opencv-3.4.20-newer-msvc.patch b/patches/opencv-3.4.20-newer-msvc.patch index 53212e9e..313c22ab 100644 --- a/patches/opencv-3.4.20-newer-msvc.patch +++ b/patches/opencv-3.4.20-newer-msvc.patch @@ -1,15 +1,18 @@ diff -Nuarp opencv-3.4.20.orig/cmake/OpenCVDetectCXXCompiler.cmake opencv-3.4.20/cmake/OpenCVDetectCXXCompiler.cmake --- opencv-3.4.20.orig/cmake/OpenCVDetectCXXCompiler.cmake 2023-06-27 19:29:13.000000000 +0800 +++ opencv-3.4.20/cmake/OpenCVDetectCXXCompiler.cmake 2024-06-10 14:47:05.286016469 +0800 -@@ -169,7 +169,7 @@ elseif(MSVC) +@@ -169,8 +169,10 @@ elseif(MSVC) set(OpenCV_RUNTIME vc15) elseif(MSVC_VERSION MATCHES "^192[0-9]$") set(OpenCV_RUNTIME vc16) - elseif(MSVC_VERSION MATCHES "^193[0-9]$") + elseif(MSVC_VERSION MATCHES "^19[34][0-9]$") set(OpenCV_RUNTIME vc17) ++ elseif(MSVC_VERSION MATCHES "^195[0-9]$") ++ set(OpenCV_RUNTIME vc18) else() message(WARNING "OpenCV does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set OpenCV_RUNTIME") + endif() diff -Nuarp opencv-3.4.20.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in opencv-3.4.20/cmake/templates/OpenCVConfig.root-WIN32.cmake.in --- opencv-3.4.20.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2023-06-27 19:29:13.000000000 +0800 +++ opencv-3.4.20/cmake/templates/OpenCVConfig.root-WIN32.cmake.in 2024-06-10 14:46:17.345712729 +0800 @@ -22,3 +25,28 @@ diff -Nuarp opencv-3.4.20.orig/cmake/templates/OpenCVConfig.root-WIN32.cmake.in set(OpenCV_RUNTIME vc17) check_one_config(has_VS2022) if(NOT has_VS2022) +@@ -151,6 +151,24 @@ elseif(MSVC) + endif() + endif() + endif() ++ elseif(MSVC_VERSION MATCHES "^195[0-9]$") ++ set(OpenCV_RUNTIME vc18) ++ check_one_config(has_VS2026) ++ if(NOT has_VS2026) ++ set(OpenCV_RUNTIME vc17) # selecting previous compatible runtime version ++ check_one_config(has_VS2022) ++ if(NOT has_VS2022) ++ set(OpenCV_RUNTIME vc16) # selecting previous compatible runtime version ++ check_one_config(has_VS2019) ++ if(NOT has_VS2019) ++ set(OpenCV_RUNTIME vc15) # selecting previous compatible runtime version ++ check_one_config(has_VS2017) ++ if(NOT has_VS2017) ++ set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version ++ endif() ++ endif() ++ endif() ++ endif() + endif() + elseif(MINGW) + set(OpenCV_RUNTIME mingw) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 79a93393..10847f30 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -25,6 +25,11 @@ endif() add_executable(opencv-mobile-test main.cpp) +set(OPENCV_MOBILE_TEST_POINTER_SIZE "" CACHE STRING "Expected pointer size for the test target") +if(OPENCV_MOBILE_TEST_POINTER_SIZE) + target_compile_definitions(opencv-mobile-test PRIVATE OPENCV_MOBILE_TEST_POINTER_SIZE=${OPENCV_MOBILE_TEST_POINTER_SIZE}) +endif() + if(NOT OPENCV_MOBILE_TEST_CXX_STANDARD AND DEFINED OpenCV_VERSION) if(OpenCV_VERSION VERSION_GREATER_EQUAL 5) set(OPENCV_MOBILE_TEST_CXX_STANDARD 17) diff --git a/test/main.cpp b/test/main.cpp index f8d2873d..14e54cec 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -2,6 +2,10 @@ #include #include +#ifdef OPENCV_MOBILE_TEST_POINTER_SIZE +typedef char opencv_mobile_test_pointer_size[sizeof(void*) == OPENCV_MOBILE_TEST_POINTER_SIZE ? 1 : -1]; +#endif + int main() { cv::Mat bgr = cv::imread("in.jpg", 1); From 24f513f45ac0e3df7cbc28fca7e686235374af43 Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 20 Oct 2026 13:09:37 +0800 Subject: [PATCH 2/4] Apply WebAssembly thread options after shared defaults --- .github/workflows/release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88538c48..fd263ce4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1868,10 +1868,10 @@ jobs: patch -p1 -i ../patches/opencv-${{ matrix.opencv-version }}-unsafe-xadd.patch mkdir build && cd build cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=OFF -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ + -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ - `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-simd @@ -1880,10 +1880,10 @@ jobs: cd ${{ env.SOURCE_DIR }} mkdir build-simd && cd build-simd cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=OFF -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ + -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ - `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-threads @@ -1893,10 +1893,10 @@ jobs: patch -p1 -R -i ../patches/opencv-${{ matrix.opencv-version }}-unsafe-xadd.patch mkdir build-threads && cd build-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=ON -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ + -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ - `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-simd-threads @@ -1905,10 +1905,10 @@ jobs: cd ${{ env.SOURCE_DIR }} mkdir build-simd-threads && cd build-simd-threads cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ - -DCPU_BASELINE="" -DCPU_DISPATCH="" -DWITH_PTHREADS_PF=ON -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ + -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ - `cat ../options.txt` -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: package From 32b9aaaec93b2b75792142a71e883ce3979a97db Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 20 Oct 2026 13:12:55 +0800 Subject: [PATCH 3/4] Fix Emscripten runtime linking and PowerShell CMake version quoting --- .github/workflows/release.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fd263ce4..0f88a09a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,6 +11,10 @@ on: tags: - '*' +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + env: DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer IOS_DEPLOYMENT_TARGET: '13.0' @@ -1665,7 +1669,7 @@ jobs: runs-on: windows-${{ matrix.os-compiler.windows-version }} env: UseMultiToolTask: true - COMMON_CMAKE_OPTIONS: -G "${{ matrix.os-compiler.msvc-version == 'vs2026' && 'Visual Studio 18 2026' || 'Visual Studio 17 2022' }}" -T ${{ matrix.os-compiler.toolset-version }},host=x64 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=install + COMMON_CMAKE_OPTIONS: -G "${{ matrix.os-compiler.msvc-version == 'vs2026' && 'Visual Studio 18 2026' || 'Visual Studio 17 2022' }}" -T ${{ matrix.os-compiler.toolset-version }},host=x64 "-DCMAKE_POLICY_VERSION_MINIMUM=3.5" -DCMAKE_INSTALL_PREFIX=install steps: - uses: actions/checkout@v7 - uses: actions/download-artifact@v8 @@ -1871,7 +1875,7 @@ jobs: -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ - `cat ../options.txt` -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_OPENMP=OFF -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-simd @@ -1883,7 +1887,7 @@ jobs: -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ - `cat ../options.txt` -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_OPENMP=OFF -DWITH_PTHREADS_PF=OFF -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-threads @@ -1896,7 +1900,7 @@ jobs: -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=OFF -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ - `cat ../options.txt` -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_OPENMP=OFF -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: build-simd-threads @@ -1908,7 +1912,7 @@ jobs: -DCPU_BASELINE="" -DCPU_DISPATCH="" -DCV_ENABLE_INTRINSICS=ON -DBUILD_WASM_INTRIN_TESTS=OFF \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ - `cat ../options.txt` -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. + `cat ../options.txt` -DWITH_OPENMP=OFF -DWITH_PTHREADS_PF=ON -DBUILD_opencv_world=OFF -DOPENCV_DISABLE_FILESYSTEM_SUPPORT=ON .. cmake --build . -j $(nproc) cmake --build . --target install - name: package From 38cc17a40b41448b8a889fa15b411b88138364af Mon Sep 17 00:00:00 2001 From: nihui Date: Tue, 20 Oct 2026 14:12:43 +0800 Subject: [PATCH 4/4] Keep release platform changes scoped to tag builds --- .github/workflows/release.yml | 34 ++-------------------------------- test/CMakeLists.txt | 5 ----- test/main.cpp | 4 ---- 3 files changed, 2 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f88a09a..e96b8166 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,20 +1,9 @@ name: release on: - pull_request: - paths: - - ".github/workflows/release.yml" - - "patches/**" - - "highgui/**" - - "test/**" - - "opencv*_cmake_options.txt" push: tags: - '*' -concurrency: - group: release-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - env: DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer IOS_DEPLOYMENT_TARGET: '13.0' @@ -365,7 +354,6 @@ jobs: path: opencv-mobile-5.0.0.zip android: - if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -469,7 +457,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip harmonyos: - if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -569,7 +556,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip ios: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -658,7 +644,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip ios-simulator: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -757,7 +742,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip armlinux: - if: github.event_name != 'pull_request' needs: [setup] runs-on: ubuntu-latest strategy: @@ -856,7 +840,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip macos: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -959,7 +942,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip mac-catalyst: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1058,7 +1040,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip watchos: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1144,7 +1125,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip watchos-simulator: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1243,7 +1223,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip tvos: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1348,7 +1327,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip tvos-simulator: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1447,7 +1425,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip visionos: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1536,7 +1513,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip visionos-simulator: - if: github.event_name != 'pull_request' needs: [setup] runs-on: macos-14 strategy: @@ -1840,8 +1816,8 @@ jobs: matrix: opencv-version: [2.4.13.7, 3.4.20, 4.14.0, 5.0.0] arch: - - { name: webassembly, flags: "", pointer-size: 4 } - - { name: webassembly64, flags: "-m64", pointer-size: 8 } + - { name: webassembly, flags: "" } + - { name: webassembly64, flags: "-m64" } env: COMMON_CMAKE_OPTIONS: | -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ @@ -1942,7 +1918,6 @@ jobs: cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions" \ - -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/basic/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-simd @@ -1953,7 +1928,6 @@ jobs: cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -msimd128" \ - -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/simd/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-threads @@ -1964,7 +1938,6 @@ jobs: cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4" \ - -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/threads/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: test-simd-threads @@ -1975,7 +1948,6 @@ jobs: cmake ${{ env.COMMON_CMAKE_OPTIONS }} \ -DCMAKE_C_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ -DCMAKE_CXX_FLAGS="${{ matrix.arch.flags }} -fno-rtti -fno-exceptions -pthread -s PTHREAD_POOL_SIZE=4 -msimd128" \ - -DOPENCV_MOBILE_TEST_POINTER_SIZE=${{ matrix.arch.pointer-size }} \ -DOpenCV_DIR=$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/simd-threads/${{ env.OPENCV_SUBDIR }} .. cmake --build . -j $(nproc) - name: upload @@ -1985,7 +1957,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip apple: - if: github.event_name != 'pull_request' needs: [macos, ios, ios-simulator, mac-catalyst, watchos, watchos-simulator, tvos, tvos-simulator, visionos, visionos-simulator] runs-on: macos-14 strategy: @@ -2091,7 +2062,6 @@ jobs: path: ${{ env.PACKAGE_NAME }}.zip devboard: - if: github.event_name != 'pull_request' needs: [setup] name: "devboard-${{ matrix.name }} (${{ matrix.opencv-version }})" runs-on: ubuntu-latest diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 10847f30..79a93393 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -25,11 +25,6 @@ endif() add_executable(opencv-mobile-test main.cpp) -set(OPENCV_MOBILE_TEST_POINTER_SIZE "" CACHE STRING "Expected pointer size for the test target") -if(OPENCV_MOBILE_TEST_POINTER_SIZE) - target_compile_definitions(opencv-mobile-test PRIVATE OPENCV_MOBILE_TEST_POINTER_SIZE=${OPENCV_MOBILE_TEST_POINTER_SIZE}) -endif() - if(NOT OPENCV_MOBILE_TEST_CXX_STANDARD AND DEFINED OpenCV_VERSION) if(OpenCV_VERSION VERSION_GREATER_EQUAL 5) set(OPENCV_MOBILE_TEST_CXX_STANDARD 17) diff --git a/test/main.cpp b/test/main.cpp index 14e54cec..f8d2873d 100644 --- a/test/main.cpp +++ b/test/main.cpp @@ -2,10 +2,6 @@ #include #include -#ifdef OPENCV_MOBILE_TEST_POINTER_SIZE -typedef char opencv_mobile_test_pointer_size[sizeof(void*) == OPENCV_MOBILE_TEST_POINTER_SIZE ? 1 : -1]; -#endif - int main() { cv::Mat bgr = cv::imread("in.jpg", 1);
+ Ubuntu-22.04
Ubuntu-26.04 + + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-ubuntu-2604.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-ubuntu-2604.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.14.0-ubuntu-2604.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-ubuntu-2604.zip) +
+ VS2015
VS2026 + + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-windows-vs2026.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-windows-vs2026.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.14.0-windows-vs2026.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-windows-vs2026.zip) + +
WebAssemblyWebAssembly (32-bit) [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-webassembly.zip) @@ -312,6 +334,17 @@ OpenCV **5.0.0** packages require a C++17-capable compiler. Windows OpenCV 5.0.0 [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.14.0-webassembly.zip) [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-webassembly.zip) +
WebAssembly64 + + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-2.4.13.7-webassembly64.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-3.4.20-webassembly64.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-4.14.0-webassembly64.zip) + [](https://github.com/nihui/opencv-mobile/releases/latest/download/opencv-mobile-5.0.0-webassembly64.zip) +