From 790686d1913631831cae42cd78aefc7856146d89 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Sun, 12 Jan 2025 13:40:48 +0100 Subject: [PATCH 1/2] ubuntu 24.04 compatibility and MSVC C23 (#22) * upgrade OpenEXR * upgrade libheif * set the C++ standard on the command line * use C++20 * use C++20 everywhere * ImageMagick now requires C++17 * use /std:clatest for [[fallthrough]] * set it only for C * fix typo * fix the conan cache * verbose build * set the C standard on the target * try setting on the target --- .github/workflows/cmake-build.yml | 15 ++++++++------- MagickCore/CMakeLists.txt | 5 +++++ MagickWand/CMakeLists.txt | 5 +++++ conanfile.py | 4 ++-- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake-build.yml b/.github/workflows/cmake-build.yml index 753268c8fe5..4ab57806e49 100644 --- a/.github/workflows/cmake-build.yml +++ b/.github/workflows/cmake-build.yml @@ -58,7 +58,7 @@ jobs: - name: Install all delegates run: | conan profile detect || echo ok - conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} + conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} --settings compiler.cppstd=20 echo 'CONAN_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/build/conan_toolchain.cmake"' >> $GITHUB_ENV shell: bash @@ -116,13 +116,13 @@ jobs: uses: actions/cache/restore@v4 with: path: ~/.conan2 - key: ${{ runner.os }}-${{ matrix.libtype }}-${{ matrix.buildtype }} + key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.libtype }}-${{ matrix.buildtype }} if: matrix.provider == 'conan' || matrix.provider == 'pkgconf' - name: Install all delegates (conan) run: | conan profile detect || echo ok - conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} + conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} --settings compiler.cppstd=20 echo 'CONAN_TOOLCHAIN=-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/build/conan_toolchain.cmake"' >> $GITHUB_ENV shell: bash if: matrix.provider == 'conan' @@ -132,7 +132,7 @@ jobs: - name: Install all delegates (pkgconf) run: | conan profile detect || echo ok - conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} + conan install . -of build --build=missing -o libtype=${{ matrix.libtype }} --settings=build_type=${{ matrix.buildtype }} --settings compiler.cppstd=20 echo "PKG_CONFIG_PATH=${{ github.workspace }}/build" >> $GITHUB_ENV shell: bash env: @@ -191,8 +191,9 @@ jobs: run: | mkdir -p build cd build - cmake .. ${{ env.CONAN_TOOLCHAIN }} -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} ${{ env.LIBTYPE }} \ - -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}" ${{ env.ZERO_CONF }} ${{ env.CUSTOM_DELEGATES }} + cmake .. ${{ env.CONAN_TOOLCHAIN }} -DCMAKE_BUILD_TYPE=${{ matrix.buildtype }} ${{ env.LIBTYPE }} \ + -DCMAKE_INSTALL_PREFIX="${{ env.INSTALL_PREFIX }}" ${{ env.ZERO_CONF }} ${{ env.CUSTOM_DELEGATES }} \ + -DCMAKE_VERBOSE_MAKEFILE=ON - name: Build run: cmake --build build --config ${{ matrix.buildtype }} @@ -255,7 +256,7 @@ jobs: shell: bash run: | conan profile detect || echo ok - conan install . -of build -pr:b=default -pr:h=./emscripten.profile --build=missing + conan install . -of build -pr:b=default -pr:h=./emscripten.profile --build=missing --settings compiler.cppstd=20 - name: Generate CMake build (conan) run: | diff --git a/MagickCore/CMakeLists.txt b/MagickCore/CMakeLists.txt index 30ae55990c8..24d371f4d84 100644 --- a/MagickCore/CMakeLists.txt +++ b/MagickCore/CMakeLists.txt @@ -739,6 +739,11 @@ else() target_link_options(${MAGICKCORE_BINARY_NAME} PUBLIC ${IMAGEMAGICK_DELEGATES_LDFLAGS}) endif() +if(MSVC) + # for [[fallthrough]] + target_compile_options(${MAGICKCORE_BINARY_NAME} PRIVATE /std:clatest) +endif() + set_target_properties(${MAGICKCORE_BINARY_NAME} PROPERTIES PUBLIC_HEADER "${MAGICKCORE_PUBLIC_HEADERS}") target_include_directories(${MAGICKCORE_BINARY_NAME} PUBLIC $ diff --git a/MagickWand/CMakeLists.txt b/MagickWand/CMakeLists.txt index fdb50b86d76..35b40a1cc5c 100644 --- a/MagickWand/CMakeLists.txt +++ b/MagickWand/CMakeLists.txt @@ -102,6 +102,11 @@ else() add_library(${MAGICKWAND_BINARY_NAME} STATIC ${MAGICKWAND_SRC} ${MAGICK_RESOURCE_FILE_PATH}) endif() +if(MSVC) + # for [[fallthrough]] + target_compile_options(${MAGICKWAND_BINARY_NAME} PRIVATE /std:clatest) +endif() + set_target_properties(${MAGICKWAND_BINARY_NAME} PROPERTIES PUBLIC_HEADER "${MAGICKWAND_PUBLIC_HEADERS}") target_include_directories(${MAGICKWAND_BINARY_NAME} PUBLIC $ diff --git a/conanfile.py b/conanfile.py index eb189fe9355..60072062daf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -126,13 +126,13 @@ def requirements(self): self.requires('libde265/1.0.12', force=True) if self.options.heif: - self.requires('libheif/1.13.0', force=True) + self.requires('libheif/1.19.5', force=True) if self.options.jbig: self.requires('jbig/20160605', force=True) if self.options.exr: - self.requires('openexr/3.1.5', force=True) + self.requires('openexr/3.3.2', force=True) if self.options.png: self.requires('libpng/1.6.42', force=True) From 5d1daee607308111c85c3b0c5e0fdc7a8136ad07 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Tue, 14 Jan 2025 17:17:18 +0100 Subject: [PATCH 2/2] remove unintended merge changes --- .github/workflows/codeql-analysis.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index faee24d8b7a..5170bde22e2 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -2,12 +2,17 @@ on: workflow_dispatch: schedule: - cron: 0 6 * * * + push: + branches: + - main + paths: + - '.github/workflows/codeql-analysis.yml' name: codeql analysis jobs: scan_linux: name: 'Linux Q${{matrix.quantum}}-x64 hdri=${{matrix.hdri}} (${{matrix.modules}})' - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: security-events: write @@ -24,6 +29,13 @@ jobs: with: fetch-depth: 2 + - name: Install dependencies + run: | + set -e + export DEBIAN_FRONTEND=noninteractive + sudo apt-get update -y + sudo apt-get install -y libltdl-dev + - name: Configure ImageMagick run: | export CFLAGS="-Wno-deprecated-declarations"