Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20.x'
node-version: '22.x'
- name: Update Ubuntu and install libjpeg-dev
run: |
sudo apt-get update && sudo apt install libjpeg-dev
Expand All @@ -20,7 +20,7 @@ jobs:
run: |
cd ..
ls
docker run -dit --name emscripten-webarkit-testing -v $(pwd):/src emscripten/emsdk:3.1.38 bash
docker run -dit --name emscripten-webarkit-testing -v $(pwd):/src emscripten/emsdk:3.1.69 bash
docker exec emscripten-webarkit-testing emcmake cmake -B WebARKitLib/WebARKit/build -S WebARKitLib/WebARKit -DEMSCRIPTEN_COMP=1 ..
docker exec emscripten-webarkit-testing emmake make -C WebARKitLib/WebARKit/build

32 changes: 22 additions & 10 deletions WebARKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@ if(VERSION GREATER 3.24)
endif()

include(FetchContent)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/OpenCVEm.cmake)

option(WEBARKIT_SIMD "Use the SIMD-enabled emscripten OpenCV build" OFF)

if(${EMSCRIPTEN_COMP} EQUAL 1)
message("Fetching opencv for emscripten compilation from webarkit/opencv-em ...")
FetchContent_Declare(
build_opencv
URL https://github.com/webarkit/opencv-em/releases/download/0.1.6/opencv-js-4.10.0-emcc-3.1.38.zip
)
if(WEBARKIT_SIMD)
set(OPENCV_FETCH_DESC "SIMD emscripten")
set(OPENCV_FETCH_URL ${OPENCV_EMSCRIPTEN_SIMD_URL})
set(OPENCV_FETCH_HASH ${OPENCV_EMSCRIPTEN_SIMD_HASH})
else()
set(OPENCV_FETCH_DESC "emscripten")
set(OPENCV_FETCH_URL ${OPENCV_EMSCRIPTEN_URL})
set(OPENCV_FETCH_HASH ${OPENCV_EMSCRIPTEN_HASH})
endif()
else()
message("Fetching opencv from webarkit/opencv-em ...")
FetchContent_Declare(
build_opencv
URL https://github.com/webarkit/opencv-em/releases/download/0.1.6/opencv-4.10.0.zip
)
set(OPENCV_FETCH_DESC "native")
set(OPENCV_FETCH_URL ${OPENCV_NATIVE_URL})
set(OPENCV_FETCH_HASH ${OPENCV_NATIVE_HASH})
endif()

message("Fetching ${OPENCV_FETCH_DESC} opencv from webarkit/opencv-em ${OPENCV_EM_RELEASE} ...")
FetchContent_Declare(
build_opencv
URL ${OPENCV_FETCH_URL}
URL_HASH ${OPENCV_FETCH_HASH}
)

FetchContent_MakeAvailable(build_opencv)

get_filename_component(PARENT_DIR ./ ABSOLUTE)
Expand Down
13 changes: 13 additions & 0 deletions cmake/OpenCVEm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Shared webarkit/opencv-em release coordinates.
# Bump OPENCV_EM_RELEASE (and the three hashes below) to upgrade opencv-em.
set(OPENCV_EM_RELEASE "0.2.0")
set(OPENCV_EM_BASE_URL "https://github.com/webarkit/opencv-em/releases/download/${OPENCV_EM_RELEASE}")

set(OPENCV_NATIVE_URL "${OPENCV_EM_BASE_URL}/opencv-4.12.0.zip")
set(OPENCV_NATIVE_HASH "SHA256=eb68b3c6cac2781f6bbbe747d9ac8f27c5d716471da82d6c4fd79f26a18263b4")

set(OPENCV_EMSCRIPTEN_URL "${OPENCV_EM_BASE_URL}/opencv-js-4.12.0-emcc-3.1.69.zip")
set(OPENCV_EMSCRIPTEN_HASH "SHA256=3a9509615bed922b058e3201007c8b9b29c1e5aa3dd0750676b7d847738ce2c7")

set(OPENCV_EMSCRIPTEN_SIMD_URL "${OPENCV_EM_BASE_URL}/opencv-js-4.12.0-emcc-3.1.69-simd.zip")
set(OPENCV_EMSCRIPTEN_SIMD_HASH "SHA256=3600fd9d0422cb1fc19306bb1f876a578dff970f207947b346180993dfa27026")
4 changes: 3 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endif()

# Fetch googletest v1.13.0 commit b796f7d44681514f58a683a3a71ff17c94edb0c1
include(FetchContent)
include(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/OpenCVEm.cmake)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/b796f7d44681514f58a683a3a71ff17c94edb0c1.zip
Expand All @@ -19,7 +20,8 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

FetchContent_Declare(
build_opencv
URL https://github.com/webarkit/opencv-em/releases/download/0.1.6/opencv-4.10.0.zip
URL ${OPENCV_NATIVE_URL}
URL_HASH ${OPENCV_NATIVE_HASH}
)

FetchContent_MakeAvailable(googletest build_opencv)
Expand Down