From e2adfe382a94cbbe089addc14623c903789c6640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 09:00:27 +0100 Subject: [PATCH 1/7] feat: add support for .avif images --- .gitmodules | 3 ++ CMakeLists.txt | 6 +++- README.md | 3 +- dependencies/CMakeLists.txt | 59 ++++++++++++++++++++++++------------- dependencies/aom | 1 + dependencies/libheif | 2 +- flake.nix | 1 + src/HelpWindow.cpp | 3 ++ src/ImageViewer.cpp | 7 +++-- 9 files changed, 59 insertions(+), 26 deletions(-) create mode 160000 dependencies/aom diff --git a/.gitmodules b/.gitmodules index 7a3fdef0..f9f2b50e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "dependencies/libde265"] path = dependencies/libde265 url = https://github.com/strukturag/libde265 +[submodule "dependencies/aom"] + path = dependencies/aom + url = https://aomedia.googlesource.com/aom diff --git a/CMakeLists.txt b/CMakeLists.txt index 17b86446..019523be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,10 @@ elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) set(TEV_VERSION_ARCH "${TEV_VERSION} (32 bit)") endif() +option(TEV_SUPPORT_AVIF "Support loading AVIF images" ON) option(TEV_SUPPORT_HEIC "Support loading HEIC images" OFF) -set(TEV_USE_LIBHEIF ${TEV_SUPPORT_HEIC}) # If other codecs supported by heif are used, adjust this condition. +set(TEV_USE_LIBHEIF ${TEV_SUPPORT_AVIF} OR ${TEV_SUPPORT_HEIC}) # Set ourselves as the startup project in visual studio. # Not available until cmake 3.6, but doesn't break older versions. @@ -244,6 +245,9 @@ if (APPLE) # in keeping the warnings around. set(TEV_DEFINITIONS ${TEV_DEFINITIONS} -DGL_SILENCE_DEPRECATION) endif() +if (TEV_SUPPORT_AVIF) + set(TEV_DEFINITIONS ${TEV_DEFINITIONS} -DTEV_SUPPORT_AVIF) +endif() if (TEV_SUPPORT_HEIC) set(TEV_DEFINITIONS ${TEV_DEFINITIONS} -DTEV_SUPPORT_HEIC) endif() diff --git a/README.md b/README.md index 6fbfe6b1..60bb836f 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ All that is required for building __tev__ is [CMake](https://cmake.org/) and a C Most Linux distributions additionally require _xorg_, _gl_, _zlib_, and _zenity_. On Ubuntu/Debian simply call ```sh -$ apt-get install cmake xorg-dev libglu1-mesa-dev zlib1g-dev zenity +$ apt-get install cmake xorg-dev libglu1-mesa-dev yasm zlib1g-dev zenity ``` Once all dependencies are installed, begin by cloning this repository and all its submodules using the following command: @@ -146,6 +146,7 @@ $ cpack --config build/CPackConfig.cmake - __QOI__ (via [qoi](https://github.com/phoboslab/qoi). Shoutout to [Tiago Chaves](https://github.com/laurelkeys) for adding support!) - __DDS__ (via [DirectXTex](https://github.com/microsoft/DirectXTex); Windows only. Shoutout to [Craig Kolb](https://github.com/cek) for adding support!) - Supports BC1-BC7 compressed formats. +- __AVIF__ (via [aom](https://aomedia.googlesource.com/aom)+[libheif](https://github.com/strukturag/libheif)) - __HEIC__ (via [libde265](https://github.com/strukturag/libde265)+[libheif](https://github.com/strukturag/libheif); disabled in binary release. You must build __tev__ yourself with the `TEV_SUPPORT_HEIC` CMake option. Check patent laws in your juristiction before enabling this feature.) ## License diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 0e1c0d19..b679d80c 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -49,24 +49,15 @@ if (WIN32) include_directories(${DIRECTXTEX_INCLUDE_DIR}) endif() -# Compile OpenEXR -set(IMATH_INSTALL OFF CACHE BOOL " " FORCE) -set(IMATH_INSTALL_PKG_CONFIG OFF CACHE BOOL " " FORCE) -add_subdirectory(Imath) - -set(LIBDEFLATE_BUILD_SHARED_LIB OFF CACHE BOOL " " FORCE) -set(LIBDEFLATE_BUILD_GZIP OFF CACHE BOOL " " FORCE) -add_subdirectory(libdeflate EXCLUDE_FROM_ALL) - -set(OPENEXR_FORCE_INTERNAL_DEFLATE ON CACHE BOOL " " FORCE) -set(EXR_DEFLATE_LIB libdeflate::libdeflate_static) +# Compile aom (dependency of libheif, which follows) +if (TEV_SUPPORT_AVIF) + set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) + set(ENABLE_DOCS OFF CACHE BOOL " " FORCE) + add_subdirectory(aom EXCLUDE_FROM_ALL) -set(OPENEXR_INSTALL OFF CACHE BOOL " " FORCE) -set(OPENEXR_INSTALL_TOOLS OFF CACHE BOOL " " FORCE) -set(OPENEXR_INSTALL_PKG_CONFIG OFF CACHE BOOL " " FORCE) -set(OPENEXR_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) -set(OPENEXR_BUILD_TOOLS OFF CACHE BOOL " " FORCE) -add_subdirectory(openexr) + set(AOM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/aom" CACHE PATH " " FORCE) + set(AOM_LIBRARY aom) +endif() # Compile libde265 (dependency of libheif, which follows) if (TEV_SUPPORT_HEIC) @@ -76,7 +67,6 @@ if (TEV_SUPPORT_HEIC) set(LIBDE265_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libde265" CACHE PATH " " FORCE) set(LIBDE265_LIBRARY de265) - include_directories("${CMAKE_CURRENT_BINARY_DIR}/libde265") endif() # Compile libheif @@ -87,6 +77,7 @@ if (TEV_USE_LIBHEIF) set(WITH_EXAMPLES OFF CACHE BOOL " " FORCE) set(WITH_FUZZERS OFF CACHE BOOL " " FORCE) set(WITH_GDK_PIXBUF OFF CACHE BOOL " " FORCE) + set(WITH_INSTALL OFF CACHE BOOL " " FORCE) # Codecs set(WITH_LIBDE265 ${TEV_SUPPORT_HEIC}) @@ -94,10 +85,10 @@ if (TEV_USE_LIBHEIF) set(WITH_OpenH264_ENCODER OFF CACHE BOOL " " FORCE) set(WITH_OpenH264_DECODER OFF CACHE BOOL " " FORCE) - # TODO: Add aom as dependency to let libheif decode avif images for us. - # Also consider adding JPEG2000 support via libheif. set(WITH_AOM_ENCODER OFF CACHE BOOL " " FORCE) - set(WITH_AOM_DECODER OFF CACHE BOOL " " FORCE) + set(WITH_AOM_DECODER ${TEV_SUPPORT_AVIF} CACHE BOOL " " FORCE) + + # TODO: Also consider adding JPEG2000 support via libheif. # libsharpyuv is not needed for us, because we're not interested in converting from RGB to YUV. tev is primarily an image viewer that # goes from YUV to RGB upon loading images, where libsharpyuv does nothing. See https://www.ctrl.blog/entry/webp-sharp-yuv.html for more @@ -105,10 +96,36 @@ if (TEV_USE_LIBHEIF) set(WITH_LIBSHARPYUV OFF CACHE BOOL " " FORCE) add_subdirectory(libheif EXCLUDE_FROM_ALL) + target_include_directories(heif PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/aom") + target_include_directories(heif PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/libde265") set(LIBHEIF_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libheif/libheif/api" "${CMAKE_CURRENT_BINARY_DIR}/libheif" PARENT_SCOPE) endif() +# Compile OpenEXR +set(IMATH_INSTALL OFF CACHE BOOL " " FORCE) +set(IMATH_INSTALL_PKG_CONFIG OFF CACHE BOOL " " FORCE) +add_subdirectory(Imath) + +set(LIBDEFLATE_BUILD_SHARED_LIB OFF CACHE BOOL " " FORCE) +set(LIBDEFLATE_BUILD_GZIP OFF CACHE BOOL " " FORCE) +add_subdirectory(libdeflate EXCLUDE_FROM_ALL) + +set(OPENEXR_FORCE_INTERNAL_DEFLATE ON CACHE BOOL " " FORCE) +set(EXR_DEFLATE_LIB libdeflate::libdeflate_static) + +set(OPENEXR_INSTALL OFF CACHE BOOL " " FORCE) +set(OPENEXR_INSTALL_TOOLS OFF CACHE BOOL " " FORCE) +set(OPENEXR_INSTALL_PKG_CONFIG OFF CACHE BOOL " " FORCE) +set(OPENEXR_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) +set(OPENEXR_BUILD_TOOLS OFF CACHE BOOL " " FORCE) +add_subdirectory(openexr) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + # Fix compilation on Linux when code security checks are enabled + target_compile_definitions(OpenEXRCore PRIVATE _GNU_SOURCE) +endif() + # Compile clip set(CLIP_EXAMPLES OFF CACHE BOOL " " FORCE) set(CLIP_TESTS OFF CACHE BOOL " " FORCE) diff --git a/dependencies/aom b/dependencies/aom new file mode 160000 index 00000000..99fcd816 --- /dev/null +++ b/dependencies/aom @@ -0,0 +1 @@ +Subproject commit 99fcd816eeaa7da46688bc4b9f4f9e71be13c2e8 diff --git a/dependencies/libheif b/dependencies/libheif index 53becdac..9c68df7d 160000 --- a/dependencies/libheif +++ b/dependencies/libheif @@ -1 +1 @@ -Subproject commit 53becdac3dc95b7657a8ad88117504e4b8d7b853 +Subproject commit 9c68df7d9735d15ce673917f11192d160294c1a9 diff --git a/flake.nix b/flake.nix index dabce419..e5f02ac9 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,7 @@ # Common build inputs shared between dev shell and build commonBuildInputs = with pkgs; [ cmake + yasm ]; tev = pkgs.stdenv.mkDerivation { diff --git a/src/HelpWindow.cpp b/src/HelpWindow.cpp index 05b0d320..6636addb 100644 --- a/src/HelpWindow.cpp +++ b/src/HelpWindow.cpp @@ -179,6 +179,9 @@ HelpWindow::HelpWindow(Widget* parent, bool supportsHdr, function closeC addSpacer(about, 20); addLibrary(about, "args", "", "Single-header argument parsing library"); +#ifdef TEV_SUPPORT_AVIF + addLibrary(about, "aom", "", "Alliance for Open Media Video Codec"); +#endif addLibrary(about, "clip", "", "Cross-platform clipboard library"); addLibrary(about, "{fmt}", "", "Fast & safe formatting library"); addLibrary(about, "Glad", "", "Multi-language GL loader-generator"); diff --git a/src/ImageViewer.cpp b/src/ImageViewer.cpp index 05baf38e..0a7b59bd 100644 --- a/src/ImageViewer.cpp +++ b/src/ImageViewer.cpp @@ -1735,7 +1735,10 @@ void ImageViewer::toggleHelpWindow() { void ImageViewer::openImageDialog() { vector paths = file_dialog( { - // HDR formats + // HDR formats +#ifdef TEV_SUPPORT_AVIF + {"avif", "AV1 Image File" }, +#endif {"exr", "OpenEXR image" }, {"hdr", "HDR image" }, #ifdef TEV_SUPPORT_HEIC @@ -1743,7 +1746,7 @@ void ImageViewer::openImageDialog() { #endif {"pfm", "Portable Float Map image" }, // LDR formats - {"bmp", "Bitmap Image File" }, + {"bmp", "Bitmap image" }, {"gif", "Graphics Interchange Format image"}, {"jpg", "JPEG image" }, {"jpeg", "JPEG image" }, From ca1a59c5d3d2ba3e3894febf0751bb0c9b8683c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 09:01:01 +0100 Subject: [PATCH 2/7] chore: update openexr dependencies --- dependencies/Imath | 2 +- dependencies/libdeflate | 2 +- dependencies/openexr | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies/Imath b/dependencies/Imath index 1f167f47..1e16711d 160000 --- a/dependencies/Imath +++ b/dependencies/Imath @@ -1 +1 @@ -Subproject commit 1f167f471cf969107439e154f7b8901806e3a66c +Subproject commit 1e16711d46102b1158514057fc4ca9886cc9f333 diff --git a/dependencies/libdeflate b/dependencies/libdeflate index b03254d9..8d351ab3 160000 --- a/dependencies/libdeflate +++ b/dependencies/libdeflate @@ -1 +1 @@ -Subproject commit b03254d978d7af21a7512dee8fdc3367bc15c656 +Subproject commit 8d351ab307e91f5de980215c6fea2816374f93e8 diff --git a/dependencies/openexr b/dependencies/openexr index 1719d067..df162955 160000 --- a/dependencies/openexr +++ b/dependencies/openexr @@ -1 +1 @@ -Subproject commit 1719d067dc45b5b148498b1148a48aca02d78c13 +Subproject commit df162955c613d17f966dd4d42a6c9582a3d57683 From d03fe7217c1e1c55d87afc34e45987799f1812cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 12:24:35 +0100 Subject: [PATCH 3/7] ci: update dependencies --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a1a4c3d..15d7433f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,12 +21,10 @@ jobs: env: build_dir: "build" config: "Release" - CC: gcc-10 - CXX: g++-10 APPIMAGE_EXTRACT_AND_RUN: 1# https://github.com/AppImage/AppImageKit/wiki/FUSE#docker steps: - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake gcc-10 g++-10 libglu1-mesa-dev xorg-dev zenity zlib1g-dev + run: sudo apt-get update && sudo apt-get install -y cmake libglu1-mesa-dev xorg-dev yasm zenity zlib1g-dev - uses: actions/checkout@v1 with: submodules: recursive @@ -49,6 +47,8 @@ jobs: name: Build on macOS runs-on: macos-13 steps: + - name: Install dependencies + run: brew install yasm - uses: actions/checkout@v1 with: submodules: recursive @@ -68,6 +68,8 @@ jobs: build_dir: "build" config: "Release" steps: + - name: Install dependencies + run: choco install yasm - uses: actions/checkout@v1 with: submodules: recursive From eb622731d4543e3e9239bd8ba6953596a0340352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 12:41:01 +0100 Subject: [PATCH 4/7] ci: target generic CPUs in release binaries --- .github/workflows/main.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 15d7433f..b70aced4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,15 +21,17 @@ jobs: env: build_dir: "build" config: "Release" + CC: gcc-10 + CXX: g++-10 APPIMAGE_EXTRACT_AND_RUN: 1# https://github.com/AppImage/AppImageKit/wiki/FUSE#docker steps: - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y cmake libglu1-mesa-dev xorg-dev yasm zenity zlib1g-dev + run: sudo apt-get update && sudo apt-get install -y cmake gcc-10 g++-10 libglu1-mesa-dev xorg-dev zenity zlib1g-dev - uses: actions/checkout@v1 with: submodules: recursive - name: CMake - run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} + run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic - name: Build working-directory: ${{ env.build_dir }} run: cmake --build . --target all --verbose -j @@ -47,13 +49,11 @@ jobs: name: Build on macOS runs-on: macos-13 steps: - - name: Install dependencies - run: brew install yasm - uses: actions/checkout@v1 with: submodules: recursive - name: Build - run: scripts/create-dmg.sh -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} + run: scripts/create-dmg.sh -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic - name: Upload .dmg if: github.event_name != 'pull_request' uses: actions/upload-artifact@v4 @@ -68,13 +68,11 @@ jobs: build_dir: "build" config: "Release" steps: - - name: Install dependencies - run: choco install yasm - uses: actions/checkout@v1 with: submodules: recursive - name: CMake - run: cmake . -B ${{ env.build_dir }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} + run: cmake . -B ${{ env.build_dir }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic - name: Build working-directory: ${{ env.build_dir }} run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose From 4a4932233c263f2af2122bfdeb9f28c907d8615b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 13:01:37 +0100 Subject: [PATCH 5/7] build: fix compilation on macOS arm machines --- .gitmodules | 2 +- dependencies/CMakeLists.txt | 2 +- dependencies/aom | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index f9f2b50e..5cdf75f3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -45,4 +45,4 @@ url = https://github.com/strukturag/libde265 [submodule "dependencies/aom"] path = dependencies/aom - url = https://aomedia.googlesource.com/aom + url = https://github.com/Tom94/aom diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index b679d80c..7ed5a8e5 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -121,7 +121,7 @@ set(OPENEXR_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) set(OPENEXR_BUILD_TOOLS OFF CACHE BOOL " " FORCE) add_subdirectory(openexr) -if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") # Fix compilation on Linux when code security checks are enabled target_compile_definitions(OpenEXRCore PRIVATE _GNU_SOURCE) endif() diff --git a/dependencies/aom b/dependencies/aom index 99fcd816..22de8ecb 160000 --- a/dependencies/aom +++ b/dependencies/aom @@ -1 +1 @@ -Subproject commit 99fcd816eeaa7da46688bc4b9f4f9e71be13c2e8 +Subproject commit 22de8ecbe2cf4877399be31a1e7e3ab823c34ad9 From 51000b0deab0dec3191abcbc43c56e03bd09c3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 13:24:43 +0100 Subject: [PATCH 6/7] chore: make submodule clones shallow by default --- .gitmodules | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitmodules b/.gitmodules index 5cdf75f3..b81e093f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,48 +1,64 @@ [submodule "dependencies/args"] path = dependencies/args url = https://github.com/Taywee/args + shallow = true [submodule "dependencies/Imath"] path = dependencies/Imath url = https://github.com/AcademySoftwareFoundation/Imath + shallow = true [submodule "dependencies/openexr"] path = dependencies/openexr url = https://github.com/AcademySoftwareFoundation/openexr + shallow = true [submodule "dependencies/zlib"] path = dependencies/zlib url = https://github.com/Tom94/zlib + shallow = true [submodule "dependencies/utfcpp"] path = dependencies/utfcpp url = https://github.com/Tom94/utfcpp + shallow = true [submodule "dependencies/tinylogger"] path = dependencies/tinylogger url = https://github.com/Tom94/tinylogger + shallow = true [submodule "dependencies/clip"] path = dependencies/clip url = https://github.com/Tom94/clip + shallow = true [submodule "dependencies/DirectXTex"] path = dependencies/DirectXTex url = https://github.com/Tom94/DirectXTex + shallow = true [submodule "dependencies/nanogui"] path = dependencies/nanogui url = https://github.com/Tom94/nanogui-1 + shallow = true [submodule "dependencies/qoi"] path = dependencies/qoi url = https://github.com/phoboslab/qoi.git + shallow = true [submodule "dependencies/fmt"] path = dependencies/fmt url = https://github.com/fmtlib/fmt + shallow = true [submodule "scripts/create-dmg"] path = scripts/create-dmg url = https://github.com/create-dmg/create-dmg + shallow = true [submodule "dependencies/libdeflate"] path = dependencies/libdeflate url = https://github.com/ebiggers/libdeflate + shallow = true [submodule "dependencies/libheif"] path = dependencies/libheif url = https://github.com/Tom94/libheif + shallow = true [submodule "dependencies/libde265"] path = dependencies/libde265 url = https://github.com/strukturag/libde265 + shallow = true [submodule "dependencies/aom"] path = dependencies/aom url = https://github.com/Tom94/aom + shallow = true From a1477945ee6ba5b783226c496db24e92606bf78d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sun, 23 Feb 2025 13:41:50 +0100 Subject: [PATCH 7/7] build: target AOM at generic CPUs to remove yasm dependency Doesn't cause significant perf impact in my testing. --- .github/workflows/main.yml | 6 +++--- README.md | 2 +- dependencies/CMakeLists.txt | 1 + flake.nix | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b70aced4..0a1a4c3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: with: submodules: recursive - name: CMake - run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic + run: cmake . -B ${{ env.build_dir }} -DCMAKE_BUILD_TYPE=${{ env.config }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} - name: Build working-directory: ${{ env.build_dir }} run: cmake --build . --target all --verbose -j @@ -53,7 +53,7 @@ jobs: with: submodules: recursive - name: Build - run: scripts/create-dmg.sh -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic + run: scripts/create-dmg.sh -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} - name: Upload .dmg if: github.event_name != 'pull_request' uses: actions/upload-artifact@v4 @@ -72,7 +72,7 @@ jobs: with: submodules: recursive - name: CMake - run: cmake . -B ${{ env.build_dir }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} -DAOM_TARGET_CPU=generic + run: cmake . -B ${{ env.build_dir }} -DTEV_DEPLOY=1 -DTEV_SUPPORT_HEIC=${{ env.SUPPORT_HEIC }} - name: Build working-directory: ${{ env.build_dir }} run: cmake --build . --config ${{ env.config }} --target ALL_BUILD --verbose diff --git a/README.md b/README.md index 60bb836f..bfad7224 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ All that is required for building __tev__ is [CMake](https://cmake.org/) and a C Most Linux distributions additionally require _xorg_, _gl_, _zlib_, and _zenity_. On Ubuntu/Debian simply call ```sh -$ apt-get install cmake xorg-dev libglu1-mesa-dev yasm zlib1g-dev zenity +$ apt-get install cmake xorg-dev libglu1-mesa-dev zlib1g-dev zenity ``` Once all dependencies are installed, begin by cloning this repository and all its submodules using the following command: diff --git a/dependencies/CMakeLists.txt b/dependencies/CMakeLists.txt index 7ed5a8e5..bfe8033d 100644 --- a/dependencies/CMakeLists.txt +++ b/dependencies/CMakeLists.txt @@ -51,6 +51,7 @@ endif() # Compile aom (dependency of libheif, which follows) if (TEV_SUPPORT_AVIF) + set(AOM_TARGET_CPU "generic" CACHE STRING " " FORCE) set(BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) set(ENABLE_DOCS OFF CACHE BOOL " " FORCE) add_subdirectory(aom EXCLUDE_FROM_ALL) diff --git a/flake.nix b/flake.nix index e5f02ac9..dabce419 100644 --- a/flake.nix +++ b/flake.nix @@ -38,7 +38,6 @@ # Common build inputs shared between dev shell and build commonBuildInputs = with pkgs; [ cmake - yasm ]; tev = pkgs.stdenv.mkDerivation {