diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index f0550ddfd8..b689a4199b 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -59,13 +59,13 @@ jobs: image: aswf/ci-ocio:${{ matrix.vfx-cy }} strategy: matrix: - build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + build: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] include: # ------------------------------------------------------------------- # VFX CY2022 (Python 3.9) # ------------------------------------------------------------------- # Clang, Debug, OpenFX - - build: 12 + - build: 13 build-type: Debug build-shared: 'ON' build-docs: 'OFF' @@ -78,7 +78,7 @@ jobs: compiler-desc: Clang 9 vfx-cy: 2022 # GCC, no SSE, OpenFX - - build: 11 + - build: 12 build-type: Release build-shared: 'ON' build-docs: 'OFF' @@ -90,15 +90,28 @@ jobs: cc-compiler: gcc compiler-desc: GCC 9.3.1 vfx-cy: 2022 - # GCC, static, docs - - build: 10 + # C++14, GCC, static, docs + - build: 11 build-type: Release build-shared: 'OFF' build-docs: 'ON' build-openfx: 'OFF' use-sse: 'ON' use-openexr-half: 'OFF' - cxx-standard: 17 + cxx-standard: 14 + cxx-compiler: g++ + cc-compiler: gcc + compiler-desc: GCC 9.3.1 + vfx-cy: 2022 + # C++11 (not supported by OSL & OIIO) + - build: 10 + build-type: Release + build-shared: 'OFF' + build-docs: 'OFF' + build-openfx: 'OFF' + use-sse: 'ON' + use-openexr-half: 'OFF' + cxx-standard: 11 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC 9.3.1 @@ -127,7 +140,7 @@ jobs: build-openfx: 'ON' use-sse: 'OFF' use-openexr-half: 'ON' - cxx-standard: 17 + cxx-standard: 14 cxx-compiler: clang++ cc-compiler: clang compiler-desc: Clang 9 @@ -140,7 +153,7 @@ jobs: build-openfx: 'OFF' use-sse: 'ON' use-openexr-half: 'ON' - cxx-standard: 17 + cxx-standard: 11 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC 9.3.1 @@ -182,13 +195,13 @@ jobs: build-openfx: 'OFF' use-sse: 'ON' use-openexr-half: 'ON' - cxx-standard: 14 + cxx-standard: 11 cxx-compiler: g++ cc-compiler: gcc compiler-desc: GCC 6.3.1 vfx-cy: 2020 # ------------------------------------------------------------------- - # VFX CY2019 (Python 2.7) + # VFX CY2019 (C++11, Python 2.7) # ------------------------------------------------------------------- # Clang, static - build: 3 @@ -326,7 +339,7 @@ jobs: use-openexr-half: 'OFF' cxx-standard: 11 python-version: 3.7 - # Debug, OpenFX + # C++11, Debug, OpenFX - build: 4 build-type: Debug build-shared: 'ON' @@ -346,7 +359,7 @@ jobs: use-openexr-half: 'ON' cxx-standard: 14 python-version: 3.7 - # Static, no SSE + # C++11, Static, no SSE - build: 2 build-type: Release build-shared: 'OFF' @@ -356,7 +369,7 @@ jobs: use-openexr-half: 'OFF' cxx-standard: 11 python-version: 3.7 - # Python 2.7 + # C++11, Python 2.7 - build: 1 build-type: Release build-shared: 'ON' @@ -464,7 +477,7 @@ jobs: use-openexr-half: 'OFF' cxx-standard: 11 python-version: 3.7 - # Debug + # C++11, Debug - build: 4 build-type: Debug build-shared: 'ON' @@ -484,7 +497,7 @@ jobs: use-openexr-half: 'ON' cxx-standard: 14 python-version: 3.7 - # Static, no SSE, OpenFX + # C++11, Static, no SSE, OpenFX - build: 2 build-type: Release build-shared: 'OFF' @@ -494,7 +507,7 @@ jobs: use-openexr-half: 'OFF' cxx-standard: 11 python-version: 3.7 - # Python 2.7 + # C++11, Python 2.7 - build: 1 build-type: Release build-shared: 'ON' diff --git a/share/cmake/modules/FindOpenShadingLanguage.cmake b/share/cmake/modules/FindOpenShadingLanguage.cmake index 81d5d6bbef..b297c99998 100644 --- a/share/cmake/modules/FindOpenShadingLanguage.cmake +++ b/share/cmake/modules/FindOpenShadingLanguage.cmake @@ -58,6 +58,18 @@ if(DEFINED OSL_ROOT) endif() + +############################################################################### +### Check the C++ version ### + +# TODO: Which version starts to impose C++14? + +if(${CMAKE_CXX_STANDARD} LESS_EQUAL 11) + set(OSL_FOUND OFF) + message(WARNING "Need C++14 or higher to compile OpenShadingLanguage. Skipping build of the OSL unit tests") +endif() + + ############################################################################### ### Configure target ### diff --git a/share/cmake/utils/CppVersion.cmake b/share/cmake/utils/CppVersion.cmake index aeca6c0f5c..2e85d2f5c3 100644 --- a/share/cmake/utils/CppVersion.cmake +++ b/share/cmake/utils/CppVersion.cmake @@ -9,8 +9,8 @@ set(SUPPORTED_CXX_STANDARDS 11 14 17) string(REPLACE ";" ", " SUPPORTED_CXX_STANDARDS_STR "${SUPPORTED_CXX_STANDARDS}") if(NOT DEFINED CMAKE_CXX_STANDARD) - message(STATUS "Setting C++ version to '11' as none was specified.") - set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard to compile against") + message(STATUS "Setting C++ version to '14' as none was specified.") + set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard to compile against") elseif(NOT CMAKE_CXX_STANDARD IN_LIST SUPPORTED_CXX_STANDARDS) message(FATAL_ERROR "CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD} is unsupported. Supported standards are: ${SUPPORTED_CXX_STANDARDS_STR}.") diff --git a/src/OpenColorIO/ColorSpaceSet.cpp b/src/OpenColorIO/ColorSpaceSet.cpp index f5377c0fb1..99c659a61b 100644 --- a/src/OpenColorIO/ColorSpaceSet.cpp +++ b/src/OpenColorIO/ColorSpaceSet.cpp @@ -35,7 +35,7 @@ class ColorSpaceSet::Impl return *this; } - bool operator== (const Impl & rhs) + bool operator== (const Impl & rhs) const { if (this == &rhs) return true; diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt index 52bac9fbce..6a8ff9c7d0 100755 --- a/src/apps/CMakeLists.txt +++ b/src/apps/CMakeLists.txt @@ -8,7 +8,7 @@ if(OCIO_BUILD_APPS) add_subdirectory(ociomakeclf) add_subdirectory(ociowrite) - if(TARGET OpenImageIO::OpenImageIO) + if(OpenImageIO_FOUND AND TARGET OpenImageIO::OpenImageIO) add_subdirectory(ociolutimage) add_subdirectory(ocioconvert) add_subdirectory(ociodisplay) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2fe6c15488..d7ca44a218 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -19,7 +19,7 @@ if(OCIO_BUILD_GPU_TESTS) add_subdirectory(gpu) endif() -if(TARGET OpenImageIO::OpenImageIO) +if(OpenImageIO_FOUND AND TARGET OpenImageIO::OpenImageIO) # Running the OSL unit tests requires OSL which imposes OIIO and Imath.