From c4add9c6d5c86f2aef5d97369d872526103b9240 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Fri, 1 Oct 2021 10:32:13 -0400 Subject: [PATCH 1/3] Adsk Contrib - Change default C++ version to 14 Signed-off-by: Patrick Hodoul --- .github/workflows/ci_workflow.yml | 45 +++++++++++++++++++----------- share/cmake/utils/CppVersion.cmake | 4 +-- src/OpenColorIO/ColorSpaceSet.cpp | 2 +- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index ff5601610d..38240e8475 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -55,13 +55,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' @@ -74,7 +74,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' @@ -86,15 +86,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 @@ -123,7 +136,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 @@ -136,7 +149,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 @@ -178,13 +191,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 @@ -318,7 +331,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' @@ -338,7 +351,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' @@ -348,7 +361,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' @@ -452,7 +465,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' @@ -472,7 +485,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' @@ -482,7 +495,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/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; From 286eca7e165206cbfcc17a02e511ab8c423f5fc1 Mon Sep 17 00:00:00 2001 From: hodoulp Date: Fri, 1 Oct 2021 16:50:00 +0000 Subject: [PATCH 2/3] Fix C++11 compilation in CY2022 Linux docker Signed-off-by: hodoulp --- share/cmake/modules/FindOpenShadingLanguage.cmake | 12 ++++++++++++ src/apps/CMakeLists.txt | 2 +- tests/CMakeLists.txt | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/share/cmake/modules/FindOpenShadingLanguage.cmake b/share/cmake/modules/FindOpenShadingLanguage.cmake index 81d5d6bbef..1b8cd8cee3 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 the OSL unit tests") +endif() + + ############################################################################### ### Configure target ### 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. From 53f4322d2fa547f6ff78bf0f38bff559a5cf22a2 Mon Sep 17 00:00:00 2001 From: Patrick Hodoul Date: Mon, 4 Oct 2021 09:48:55 -0400 Subject: [PATCH 3/3] Update share/cmake/modules/FindOpenShadingLanguage.cmake Co-authored-by: Michael Dolan --- share/cmake/modules/FindOpenShadingLanguage.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/cmake/modules/FindOpenShadingLanguage.cmake b/share/cmake/modules/FindOpenShadingLanguage.cmake index 1b8cd8cee3..b297c99998 100644 --- a/share/cmake/modules/FindOpenShadingLanguage.cmake +++ b/share/cmake/modules/FindOpenShadingLanguage.cmake @@ -66,7 +66,7 @@ endif() if(${CMAKE_CXX_STANDARD} LESS_EQUAL 11) set(OSL_FOUND OFF) - message(WARNING "Need C++14 or higher to compile OpenShadingLanguage. Skipping build the OSL unit tests") + message(WARNING "Need C++14 or higher to compile OpenShadingLanguage. Skipping build of the OSL unit tests") endif()