Merge pull request #1297 from davidgyu/dev_cxx_version

Updated C++ standard to C++14
This commit is contained in:
Barry Fowler 2023-07-06 14:56:14 -07:00 committed by GitHub
commit dbb23be83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 17 deletions

View File

@ -26,6 +26,17 @@ cmake_minimum_required(VERSION 3.12)
project(OpenSubdiv)
# Set C++ standard requirements, allowing overrides
if (NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if (NOT DEFINED CMAKE_CXX_STANDARD_REQUIRED)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
set(CMAKE_CXX_EXTENSIONS OFF)
endif()
# Turn on folder support
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@ -446,12 +457,6 @@ endif()
if( METAL_FOUND AND NOT NO_METAL)
set(OSD_GPU TRUE)
if (CMAKE_COMPILER_IS_CLANGCC)
# When building with Metal support enabled, we need to explicitly
# request that the C++ code be compiled with C++11 since some example
# code for Metal relies on functionality only available in C++11.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
endif()
if( OPENGL_FOUND AND NOT NO_OPENGL)

View File

@ -157,8 +157,6 @@ if(METAL_FOUND)
mtlHud.h
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
add_library(examples_common_mtl_obj
OBJECT
${EXAMPLES_COMMON_SOURCE_FILES}

View File

@ -108,10 +108,6 @@ if(IOS)
)
endif()
set_property (TARGET mtlPtexViewer PROPERTY CXX_STANDARD 14)
target_link_libraries(mtlPtexViewer
${PLATFORM_LIBRARIES}
)

View File

@ -104,10 +104,6 @@ if(IOS)
)
endif()
set_property (TARGET mtlViewer PROPERTY CXX_STANDARD 14)
target_link_libraries(mtlViewer
${PLATFORM_LIBRARIES}
)

View File

@ -80,7 +80,6 @@ if (NOT NO_LIB)
list(APPEND PLATFORM_GPU_LIBRARIES
${METAL_LIBRARIES}
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
endif()
if ( OPENCL_FOUND )