Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adsk Contrib - Change default C++ version to 14 #1508

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions .github/workflows/ci_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
12 changes: 12 additions & 0 deletions share/cmake/modules/FindOpenShadingLanguage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###

Expand Down
4 changes: 2 additions & 2 deletions share/cmake/utils/CppVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}.")
Expand Down
2 changes: 1 addition & 1 deletion src/OpenColorIO/ColorSpaceSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down