diff --git a/.github/workflows/analysis_workflow.yml b/.github/workflows/analysis_workflow.yml index f465b5109..d72223212 100644 --- a/.github/workflows/analysis_workflow.yml +++ b/.github/workflows/analysis_workflow.yml @@ -59,7 +59,7 @@ jobs: cmake ../. \ -DCMAKE_INSTALL_PREFIX=../_install \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=14 \ + -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_FLAGS="-g -O0 -fprofile-arcs -ftest-coverage" \ -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \ -DCMAKE_EXE_LINKER_FLAGS="-lgcov" \ diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index ffb0c4c10..b688b1a19 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -59,11 +59,53 @@ jobs: # Source: https://github.com/AcademySoftwareFoundation/aswf-docker image: aswf/ci-ocio:${{ matrix.vfx-cy }}.1 strategy: - fail-fast: true + fail-fast: false matrix: - build: [7, 8, 9, 10, 11, 12] + build: [7, 8, 9, 10, 11, 12, 13, 14, 15] include: # ------------------------------------------------------------------- + # VFX CY2025 (Python 3.11) + # ------------------------------------------------------------------- + - build: 15 + build-type: Debug + build-shared: 'ON' + build-docs: 'OFF' + build-openfx: 'ON' + use-simd: 'ON' + use-oiio: 'ON' + cxx-standard: 23 + cxx-compiler: clang++ + cc-compiler: clang + compiler-desc: Clang + vfx-cy: 2025 + install-ext-packages: MISSING + - build: 14 + build-type: Release + build-shared: 'ON' + build-docs: 'ON' + build-openfx: 'ON' + use-simd: 'OFF' + use-oiio: 'OFF' + cxx-standard: 20 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: GCC + vfx-cy: 2025 + install-ext-packages: ALL + - build: 13 + build-type: Release + build-shared: 'OFF' + build-docs: 'OFF' + build-openfx: 'OFF' + use-simd: 'ON' + use-oiio: 'OFF' + cxx-standard: 23 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: GCC + vfx-cy: 2025 + install-ext-packages: ALL + # ------------------------------------------------------------------- # VFX CY2024 (Python 3.11) # ------------------------------------------------------------------- - build: 12 @@ -73,7 +115,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'ON' - cxx-standard: 17 + cxx-standard: 20 cxx-compiler: clang++ cc-compiler: clang compiler-desc: Clang @@ -99,7 +141,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC @@ -115,7 +157,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'ON' - cxx-standard: 17 + cxx-standard: 20 cxx-compiler: clang++ cc-compiler: clang compiler-desc: Clang @@ -141,7 +183,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC @@ -218,7 +260,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -257,12 +299,12 @@ jobs: strategy: fail-fast: true matrix: - build: [1, 2, 3, 4, 5, 6] + build: [1, 2, 3] include: # ------------------------------------------------------------------- # VFX CY2022 (Python 3.9) # ------------------------------------------------------------------- - - build: 6 + - build: 1 build-type: Debug build-shared: 'ON' build-docs: 'OFF' @@ -275,7 +317,7 @@ jobs: compiler-desc: Clang vfx-cy: 2022 install-ext-packages: ALL - - build: 5 + - build: 2 build-type: Release build-shared: 'ON' build-docs: 'ON' @@ -288,60 +330,18 @@ jobs: compiler-desc: GCC vfx-cy: 2022 install-ext-packages: MISSING - - build: 4 - build-type: Release - build-shared: 'OFF' - build-docs: 'OFF' - build-openfx: 'OFF' - use-simd: 'ON' - use-oiio: 'OFF' - cxx-standard: 11 - cxx-compiler: g++ - cc-compiler: gcc - compiler-desc: GCC - vfx-cy: 2022 - install-ext-packages: ALL - # ------------------------------------------------------------------- - # VFX CY2021 (Python 3.7) - # ------------------------------------------------------------------- - build: 3 - build-type: Release - build-shared: 'ON' - build-docs: 'OFF' - build-openfx: 'OFF' - use-simd: 'ON' - use-oiio: 'ON' - cxx-standard: 17 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: Clang - vfx-cy: 2021 - install-ext-packages: MISSING - - build: 2 build-type: Release build-shared: 'OFF' build-docs: 'OFF' - build-openfx: 'ON' - use-simd: 'OFF' - use-oiio: 'OFF' - cxx-standard: 14 - cxx-compiler: clang++ - cc-compiler: clang - compiler-desc: Clang - vfx-cy: 2021 - install-ext-packages: ALL - - build: 1 - build-type: Debug - build-shared: 'ON' - build-docs: 'OFF' build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC - vfx-cy: 2021 + vfx-cy: 2022 install-ext-packages: ALL env: CXX: ${{ matrix.cxx-compiler }} @@ -430,7 +430,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -472,7 +472,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'ON' - cxx-standard: 17 + cxx-standard: 20 python-version: '3.11' # Keeping one universal build - build: 4 @@ -483,7 +483,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.10' - build: 3 arch-type: "x86_64" @@ -493,7 +493,7 @@ jobs: build-openfx: 'OFF' use-simd: 'OFF' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.10' - build: 2 arch-type: "x86_64" @@ -503,7 +503,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.9' - build: 1 arch-type: "x86_64" @@ -513,7 +513,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 14 + cxx-standard: 17 python-version: '3.7' steps: - name: Setup Python @@ -588,7 +588,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -628,7 +628,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.11' - build: 2 arch-type: "x86_64;arm64" @@ -639,7 +639,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.11' steps: - name: Setup Python @@ -719,7 +719,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -761,7 +761,7 @@ jobs: build-openfx: 'ON' use-simd: 'OFF' use-oiio: 'ON' - cxx-standard: 17 + cxx-standard: 20 python-version: '3.11' - build: 3 build-type: Release @@ -770,7 +770,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.9' - build: 2 build-type: Debug @@ -779,7 +779,7 @@ jobs: build-openfx: 'OFF' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 11 + cxx-standard: 17 python-version: '3.8' # C++14, OpenEXR, OpenFX - build: 1 @@ -789,7 +789,7 @@ jobs: build-openfx: 'ON' use-simd: 'ON' use-oiio: 'OFF' - cxx-standard: 14 + cxx-standard: 17 python-version: '3.7' steps: - name: Setup Python @@ -874,7 +874,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ diff --git a/.github/workflows/dependencies_latest.yml b/.github/workflows/dependencies_latest.yml index 9cebbb3ce..d7cd214a0 100644 --- a/.github/workflows/dependencies_latest.yml +++ b/.github/workflows/dependencies_latest.yml @@ -106,12 +106,12 @@ jobs: - name: Install fixed ext package versions # Minizip-ng depends on ZLIB. ZLIB must be installed first. run: | - share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH + share/ci/scripts/multi/install_expat.sh 2.6.0 $EXT_PATH share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH - share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH - share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH + share/ci/scripts/multi/install_yaml-cpp.sh 0.8.0 $EXT_PATH + share/ci/scripts/multi/install_pystring.sh 1.1.4 $EXT_PATH share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH - share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH + share/ci/scripts/multi/install_zlib.sh 1.3.1 $EXT_PATH share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH - name: Install latest ext package versions run: | @@ -211,12 +211,12 @@ jobs: - name: Install fixed ext package versions # Minizip-ng depends on ZLIB. ZLIB must be installed first. run: | - share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH + share/ci/scripts/multi/install_expat.sh 2.6.0 $EXT_PATH share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH - share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH - share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH + share/ci/scripts/multi/install_yaml-cpp.sh 0.8.0 $EXT_PATH + share/ci/scripts/multi/install_pystring.sh 1.1.4 $EXT_PATH share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH - share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH + share/ci/scripts/multi/install_zlib.sh 1.3.1 $EXT_PATH share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH - name: Install latest ext package versions run: | @@ -336,11 +336,11 @@ jobs: # Minizip-ng depends on ZLIB. ZLIB must be installed first. run: | share/ci/scripts/multi/install_lcms2.sh 2.2 $EXT_PATH - share/ci/scripts/multi/install_yaml-cpp.sh 0.7.0 $EXT_PATH - share/ci/scripts/multi/install_pystring.sh 1.1.3 $EXT_PATH + share/ci/scripts/multi/install_yaml-cpp.sh 0.8.0 $EXT_PATH + share/ci/scripts/multi/install_pystring.sh 1.1.4 $EXT_PATH share/ci/scripts/multi/install_pybind11.sh 2.9.2 $EXT_PATH - share/ci/scripts/multi/install_expat.sh 2.4.1 $EXT_PATH - share/ci/scripts/multi/install_zlib.sh 1.2.12 $EXT_PATH + share/ci/scripts/multi/install_expat.sh 2.6.0 $EXT_PATH + share/ci/scripts/multi/install_zlib.sh 1.3.1 $EXT_PATH share/ci/scripts/multi/install_minizip-ng.sh 3.0.6 $EXT_PATH shell: bash # OSL not installed due to LLVM compilation time. diff --git a/.github/workflows/platform_latest.yml b/.github/workflows/platform_latest.yml index ab1749bab..bcc951b1a 100644 --- a/.github/workflows/platform_latest.yml +++ b/.github/workflows/platform_latest.yml @@ -153,7 +153,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -266,7 +266,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ @@ -387,7 +387,7 @@ jobs: -Dpystring_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_ROOT=${{ env.ocio_build_path }}/ext/dist \ -Dyaml-cpp_STATIC_LIBRARY=ON \ - -Dyaml-cpp_VERSION=0.7.0 \ + -Dyaml-cpp_VERSION=0.8.0 \ -DZLIB_ROOT=${{ env.ocio_build_path }}/ext/dist \ -DZLIB_STATIC_LIBRARY=ON \ -Dminizip-ng_ROOT=${{ env.ocio_build_path }}/ext/dist \ diff --git a/share/cmake/modules/FindExtPackages.cmake b/share/cmake/modules/FindExtPackages.cmake index aa2550ac7..317c8e587 100644 --- a/share/cmake/modules/FindExtPackages.cmake +++ b/share/cmake/modules/FindExtPackages.cmake @@ -55,29 +55,29 @@ message(STATUS "Checking for mandatory dependencies...") # expat # https://github.com/libexpat/libexpat ocio_handle_dependency( expat REQUIRED ALLOW_INSTALL - MIN_VERSION 2.4.1 - RECOMMENDED_VERSION 2.5.0 - RECOMMENDED_VERSION_REASON "CVE fixes and fix issue with symbol leakage when built as a static library") + MIN_VERSION 2.6.0 # CMAKE 4.0 compatible + RECOMMENDED_VERSION 2.7.2 + RECOMMENDED_VERSION_REASON "CVE fixes and Latest version tested with OCIO") # yaml-cpp # https://github.com/jbeder/yaml-cpp ocio_handle_dependency( yaml-cpp REQUIRED ALLOW_INSTALL - MIN_VERSION 0.6.3 - RECOMMENDED_VERSION 0.7.0 + MIN_VERSION 0.8.0 + RECOMMENDED_VERSION 0.8.0 RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") # pystring # https://github.com/imageworks/pystring ocio_handle_dependency( pystring REQUIRED ALLOW_INSTALL MIN_VERSION 1.1.3 - RECOMMENDED_VERSION 1.1.3 + RECOMMENDED_VERSION 1.1.4 RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") -# Imath (>=3.1) +# Imath (>=3.1.1) # https://github.com/AcademySoftwareFoundation/Imath ocio_handle_dependency( Imath REQUIRED ALLOW_INSTALL MIN_VERSION 3.1.1 - RECOMMENDED_VERSION 3.1.12 + RECOMMENDED_VERSION 3.2.1 RECOMMENDED_VERSION_REASON "Latest version tested with OCIO") ############################################################################### @@ -97,13 +97,10 @@ ocio_handle_dependency( Imath REQUIRED ALLOW_INSTALL # ZLIB_USE_STATIC_LIBS Set to ON if static library is prefered (CMake 3.24+) # ############################################################################### -# ZLIB 1.2.13 is used since it fixes a critical vulnerability. -# See https://nvd.nist.gov/vuln/detail/CVE-2022-37434 -# See https://github.com/madler/zlib/releases/tag/v1.2.13 ocio_handle_dependency( ZLIB REQUIRED ALLOW_INSTALL MIN_VERSION 1.2.8 - RECOMMENDED_VERSION 1.2.13 - RECOMMENDED_VERSION_REASON "CVE fixes" + RECOMMENDED_VERSION 1.3.1 + RECOMMENDED_VERSION_REASON "Latest version tested with OCIO" VERSION_VARS ZLIB_VERSION_STRING ZLIB_VERSION ) ############################################################################### @@ -184,7 +181,6 @@ if(OCIO_BUILD_PYTHON OR OCIO_BUILD_DOCS) endif() # Set OpenEXR Minimum version as a variable since it it used at multiple places. -set(OpenEXR_MININUM_VERSION "3.0.5") if((OCIO_BUILD_APPS AND OCIO_USE_OIIO_FOR_APPS) OR OCIO_BUILD_TESTS) # OpenImageIO is required for OSL unit test and optional for apps. @@ -259,7 +255,7 @@ if(OCIO_BUILD_APPS) ############################################################################### # Calling find_package in CONFIG mode using PREFER_CONFIG option. ocio_handle_dependency( OpenEXR PREFER_CONFIG ALLOW_INSTALL - MIN_VERSION ${OpenEXR_MININUM_VERSION} + MIN_VERSION 3.0.5 RECOMMENDED_VERSION 3.1.5 RECOMMENDED_VERSION_REASON "Latest version tested with OCIO" PROMOTE_TARGET OpenEXR::OpenEXR) diff --git a/share/cmake/modules/Findyaml-cpp.cmake b/share/cmake/modules/Findyaml-cpp.cmake index 110ae2e4c..d10bdb4f5 100644 --- a/share/cmake/modules/Findyaml-cpp.cmake +++ b/share/cmake/modules/Findyaml-cpp.cmake @@ -12,10 +12,6 @@ # Global targets defined by this module: # yaml-cpp::yaml-cpp # -# For compatibility with the upstream CMake package, the following variables and targets are defined: -# YAML_CPP_LIBRARIES - Libraries to link against yaml-cpp -# YAML_CPP_INCLUDE_DIR - Include directory -# # Usually CMake will use the dynamic library rather than static, if both are present. # In this case, you may set yaml-cpp_STATIC_LIBRARY to ON to request use of the static one. # If only the static library is present (such as when OCIO builds the dependency), then the option @@ -163,10 +159,3 @@ if (yaml-cpp_FOUND AND NOT TARGET yaml-cpp::yaml-cpp) add_library(yaml-cpp ALIAS yaml-cpp::yaml-cpp) endif () endif () - -if (yaml-cpp_FOUND) - # TODO: Remove this variable and use the `yaml-cpp::yaml-cpp` target - # directly when the minimum version of yaml-cpp is updated to 0.8. - get_target_property(YAML_CPP_INCLUDE_DIR yaml-cpp::yaml-cpp INCLUDE_DIRECTORIES) - set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp) -endif () diff --git a/share/cmake/modules/install/Installyaml-cpp.cmake b/share/cmake/modules/install/Installyaml-cpp.cmake index 6353a4d1d..2dcfadedf 100644 --- a/share/cmake/modules/install/Installyaml-cpp.cmake +++ b/share/cmake/modules/install/Installyaml-cpp.cmake @@ -12,11 +12,6 @@ # Global targets defined by this module: # yaml-cpp::yaml-cpp # -# For compatibility with the upstream CMake package, the following variables and targets are defined: -# yaml-cpp::yaml-cpp - Alias of the yaml-cpp target -# YAML_CPP_LIBRARIES - Libraries to link against yaml-cpp -# YAML_CPP_INCLUDE_DIR - Include directory -# ############################################################################### ### Create target (if previous 'find_package' call hasn't) ### @@ -118,7 +113,9 @@ if(NOT yaml-cpp_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PAC -DANDROID_STL=${ANDROID_STL}) endif() - set(yaml-cpp_GIT_TAG "yaml-cpp-${yaml-cpp_VERSION}") + # in v0.8.0 yaml switched from "yaml-cpp-vA.B.C" to "vA.B.C" format for tags. + set(yaml-cpp_GIT_TAG "${yaml-cpp_VERSION}") + # set(yaml-cpp_GIT_TAG "yaml-cpp-${yaml-cpp_VERSION}") # Hack to let imported target be built from ExternalProject_Add file(MAKE_DIRECTORY ${yaml-cpp_INCLUDE_DIR}) @@ -154,10 +151,9 @@ if(_yaml-cpp_TARGET_CREATE) set_target_properties(yaml-cpp::yaml-cpp PROPERTIES IMPORTED_LOCATION ${yaml-cpp_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES ${yaml-cpp_INCLUDE_DIR} + # https://github.com/jbeder/yaml-cpp/issues/1339 + INTERFACE_COMPILE_DEFINITIONS YAML_CPP_STATIC_DEFINE ) mark_as_advanced(yaml-cpp_INCLUDE_DIR yaml-cpp_LIBRARY yaml-cpp_VERSION) endif() - -set(YAML_CPP_INCLUDE_DIR "${yaml-cpp_INCLUDE_DIR}") -set(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp) diff --git a/share/cmake/utils/CompilerFlags.cmake b/share/cmake/utils/CompilerFlags.cmake index d87e73f2d..3e609ef6a 100644 --- a/share/cmake/utils/CompilerFlags.cmake +++ b/share/cmake/utils/CompilerFlags.cmake @@ -60,12 +60,13 @@ if(USE_MSVC) # /we4062 Enables warning in switch when an enumeration value is not explicitly handled. set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/EHsc;/DWIN32;/we4062") - if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17) - # Inheriting from std::iterator is deprecated starting with C++17 and Yaml 0.6.3 does that. - set(PLATFORM_COMPILE_OPTIONS - "${PLATFORM_COMPILE_OPTIONS};/D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING" - ) - endif() + # seems no longer needed, there were c++ modernization on 0.7.0. /coz +# if(${CMAKE_CXX_STANDARD} GREATER_EQUAL 17) +# # Inheriting from std::iterator is deprecated starting with C++17 and Yaml 0.6.3 does that. +# set(PLATFORM_COMPILE_OPTIONS +# "${PLATFORM_COMPILE_OPTIONS};/D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING" +# ) +# endif() # Make MSVC compiler report correct __cplusplus version (otherwise reports 199711L) set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/Zc:__cplusplus") diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake index 175d89c20..127ec9e7f 100644 --- a/share/cmake/utils/CppVersion.cmake +++ b/share/cmake/utils/CppVersion.cmake @@ -5,12 +5,12 @@ ############################################################################### # C++ version configuration -set(SUPPORTED_CXX_STANDARDS 11 14 17) +set(SUPPORTED_CXX_STANDARDS 17 20 23) string(REPLACE ";" ", " SUPPORTED_CXX_STANDARDS_STR "${SUPPORTED_CXX_STANDARDS}") if(NOT DEFINED CMAKE_CXX_STANDARD) - message(STATUS "Setting C++ version to '14' as none was specified.") - set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to compile against") + message(STATUS "Setting C++ version to '17' as none was specified.") + set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to compile against") elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) message(WARNING "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") @@ -29,48 +29,45 @@ else() set(CUSTOM_CXX_FLAGS "-w") endif() -if(${CMAKE_CXX_STANDARD} EQUAL 11) +if(${CMAKE_CXX_STANDARD} EQUAL 17) if(USE_MSVC) - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++11" COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++17" COMPILER_SUPPORTS_CXX17) else() - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++11" COMPILER_SUPPORTS_CXX11) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++17" COMPILER_SUPPORTS_CXX17) endif() - if(NOT COMPILER_SUPPORTS_CXX11) - message(STATUS - "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++11 only support. Use C++14.") - set(CMAKE_CXX_STANDARD 14) + if(NOT COMPILER_SUPPORTS_CXX17) + message(FATAL_ERROR + "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++17 support.") endif() endif() -if(${CMAKE_CXX_STANDARD} EQUAL 14) +if(${CMAKE_CXX_STANDARD} EQUAL 20) if(USE_MSVC) - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++14" COMPILER_SUPPORTS_CXX14) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++20" COMPILER_SUPPORTS_CXX20) else() - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++14" COMPILER_SUPPORTS_CXX14) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++20" COMPILER_SUPPORTS_CXX20) endif() - if(NOT COMPILER_SUPPORTS_CXX14) - message(STATUS - "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++14 only support. Use C++17.") - set(CMAKE_CXX_STANDARD 17) + if(NOT COMPILER_SUPPORTS_CXX20) + message(FATAL_ERROR + "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++20 support.") endif() endif() -if(${CMAKE_CXX_STANDARD} EQUAL 17) +if(${CMAKE_CXX_STANDARD} EQUAL 23) if(USE_MSVC) - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++17" COMPILER_SUPPORTS_CXX17) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std:c++23" COMPILER_SUPPORTS_CXX23) else() - CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++17" COMPILER_SUPPORTS_CXX17) + CHECK_CXX_COMPILER_FLAG("${CUSTOM_CXX_FLAGS} -std=c++23" COMPILER_SUPPORTS_CXX23) endif() - if(NOT COMPILER_SUPPORTS_CXX17) + if(NOT COMPILER_SUPPORTS_CXX23) message(FATAL_ERROR - "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++17 support.") + "The compiler ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} has no C++23 support.") endif() endif() - # Disable fallback to other C++ version if standard is not supported. set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/src/OpenColorIO/CMakeLists.txt b/src/OpenColorIO/CMakeLists.txt index 7d2894da6..ebef9328a 100755 --- a/src/OpenColorIO/CMakeLists.txt +++ b/src/OpenColorIO/CMakeLists.txt @@ -315,7 +315,7 @@ target_link_libraries(OpenColorIO "$" "$" "$" - ${YAML_CPP_LIBRARIES} + yaml-cpp::yaml-cpp MINIZIP::minizip-ng ) diff --git a/tests/cpu/CMakeLists.txt b/tests/cpu/CMakeLists.txt index 66c32cb8a..322f0f94b 100755 --- a/tests/cpu/CMakeLists.txt +++ b/tests/cpu/CMakeLists.txt @@ -35,7 +35,7 @@ function(add_ocio_test NAME SOURCES PRIVATE_INCLUDES) sampleicc::sampleicc unittest_data utils::strings - ${YAML_CPP_LIBRARIES} + yaml-cpp::yaml-cpp testutils MINIZIP::minizip-ng xxHash diff --git a/tests/cpu/fileformats/FileFormatCTF_tests.cpp b/tests/cpu/fileformats/FileFormatCTF_tests.cpp index b9b266216..05bed9bc8 100644 --- a/tests/cpu/fileformats/FileFormatCTF_tests.cpp +++ b/tests/cpu/fileformats/FileFormatCTF_tests.cpp @@ -1444,7 +1444,7 @@ OCIO_ADD_TEST(FileFormatCTF, difficult_xml_unknown_elements) OCIO::LocalCachedFileRcPtr cachedFile; { - constexpr char ErrorOutputs[11][1024] = + constexpr char ErrorOutputs[][1024] = { "(10): Unrecognized element 'Ignore' where its parent is 'ProcessList' (8): Unknown element", "(22): Unrecognized attribute 'id' of 'Array'", @@ -1454,7 +1454,7 @@ OCIO_ADD_TEST(FileFormatCTF, difficult_xml_unknown_elements) "(37): Unrecognized element 'just_ignore' where its parent is 'ProcessList' (8): Unknown element", "(69): Unrecognized element 'just_ignore' where its parent is 'Description' (66)", "(70): Unrecognized element 'just_ignore' where its parent is 'just_ignore' (69)", - "(75): Unrecognized element 'Matrix' where its parent is 'LUT1D' (43): 'Matrix' not allowed in this element", + "(75): Unrecognized element 'Matrix' where its parent is 'LUT1D'", "(76): Unrecognized element 'Description' where its parent is 'Matrix' (75)", "(77): Unrecognized element 'Array' where its parent is 'Matrix' (75)" };