Skip to content

Commit

Permalink
🔀 Merge pull request #1 from CoolLibs/webcam-mage-v3
Browse files Browse the repository at this point in the history
Get webcam image from native API
  • Loading branch information
JulesFouchy authored Oct 19, 2024
2 parents 217f587 + 2b6ded6 commit 6dece93
Show file tree
Hide file tree
Showing 53 changed files with 2,763 additions and 596 deletions.
7 changes: 4 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ Checks: '
*,
-readability-convert-member-functions-to-static,
-misc-non-private-member-variables-in-classes,
-*braces-around-statements
-readability-implicit-bool-conversion
-*braces-around-statements,
-readability-implicit-bool-conversion,
-readability-identifier-length,
-cppcoreguidelines-avoid-magic-numbers,
-readability-magic-numbers,
-readability-redundant-member-init,
-readability-redundant-access-specifiers,
-readability-redundant-string-init,
-misc-use-anonymous-namespace,
Expand All @@ -34,4 +35,4 @@ Checks: '
-objc-*,
-openmp-*,
-zircon-*,
'
'
4 changes: 1 addition & 3 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
github: [CoolLibs]
custom: https://utip.io/CoolLab
# patreon: octocat
# tidelift: npm/octo-package
patreon: Coollab
253 changes: 75 additions & 178 deletions .github/workflows/build_tests.yml
Original file line number Diff line number Diff line change
@@ -1,187 +1,84 @@
name: Build and Run tests
name: Build tests

on:
on:
push:
branches: [ main ]

branches: [main]
pull_request:
branches: [ main ]

branches: [main]

env:
TARGET: webcam_info-tests
cmake_configure_args: -D WARNINGS_AS_ERRORS_FOR_WCAM=ON
cmakelists_folder: tests
cmake_target: wcam-tests

jobs:
#-----------------------------------------------------------------------------------------------
Windows_MSVC_Debug:
name: Windows MSVC Debug
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake .\tests -B ${{github.workspace}}\build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_C_COMPILER=cl -D CMAKE_CXX_COMPILER=cl

- name: Build
run: cmake --build ${{github.workspace}}\build --config Debug --target ${{env.TARGET}}
build-and-run-tests:
name: ${{matrix.config.name}} ${{matrix.build_type}}
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
- {
name: Windows MSVC,
os: windows-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=cl CMAKE_CXX_COMPILER=cl,
}
- {
name: Windows Clang,
os: windows-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang,
}
- {
name: Windows GCC,
os: windows-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++,
}
- {
name: Linux Clang,
os: ubuntu-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++,
}
- {
name: Linux GCC,
os: ubuntu-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++,
}
- {
name: MacOS Clang,
os: macos-latest,
cmake_configure_args: -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++,
}
build_type:
- Debug
- Release

#-----------------------------------------------------------------------------------------------
Windows_MSVC_Release:
name: Windows MSVC Release
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake .\tests -B ${{github.workspace}}\build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_C_COMPILER=cl -D CMAKE_CXX_COMPILER=cl

- name: Build
run: cmake --build ${{github.workspace}}\build --config Release --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Windows_Clang_Debug:
name: Windows Clang Debug
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake .\tests -B ${{github.workspace}}\build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -T ClangCL

- name: Build
run: cmake --build ${{github.workspace}}\build --config Debug --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Windows_Clang_Release:
name: Windows Clang Release
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake .\tests -B ${{github.workspace}}\build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -T ClangCL

- name: Build
run: cmake --build ${{github.workspace}}\build --config Release --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Linux_GCC_Debug:
name: Linux GCC Debug
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Update package
run: sudo apt-get update -y

- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Linux_GCC_Release:
name: Linux GCC Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Update package
run: sudo apt-get update -y

- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Linux_Clang_Debug:
name: Linux Clang Debug
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Update package
run: sudo apt-get update -y

- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
Linux_Clang_Release:
name: Linux Clang Release
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Update package
run: sudo apt-get update -y

- name: Install glfw dependencies
run: sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
MacOS_Clang_Debug:
name: MacOS Clang Debug
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Debug -D CMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -D CMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config Debug --target ${{env.TARGET}}

#-----------------------------------------------------------------------------------------------
MacOS_Clang_Release:
name: MacOS Clang Release
runs-on: macos-11
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Configure CMake
run: cmake ./tests -B ${{github.workspace}}/build -DWARNINGS_AS_ERRORS_FOR_WEBCAM_INFO=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_C_COMPILER=$(brew --prefix llvm@15)/bin/clang -D CMAKE_CXX_COMPILER=$(brew --prefix llvm@15)/bin/clang++

- name: Build
run: cmake --build ${{github.workspace}}/build --config Release --target ${{env.TARGET}}
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up MSVC # NOTE: required to find cl.exe and clang.exe when using the Ninja generator. And we need to use Ninja in order for ccache to be able to cache stuff on Windows.
if: runner.os == 'Windows' && matrix.config.name != 'Windows GCC'
uses: ilammy/[email protected]

- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update -y
sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev mesa-common-dev
- name: ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{matrix.config.name}}-${{matrix.build_type}}

- name: Build
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: ${{github.workspace}}/${{env.cmakelists_folder}}/CMakeLists.txt
cmakeAppendedArgs: ${{env.cmake_configure_args}} -G Ninja -D CMAKE_BUILD_TYPE=${{matrix.build_type}} ${{matrix.config.cmake_configure_args}} -D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache
buildWithCMakeArgs: --config ${{matrix.build_type}} --target ${{env.cmake_target}}
cmakeBuildType: ${{matrix.build_type}}
buildDirectory: ${{github.workspace}}/build
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "tooling"]
path = tooling
url = https://github.com/CoolLibs/tooling
url = https://github.com/CoolLibs/tooling
Loading

0 comments on commit 6dece93

Please sign in to comment.