Turn on C++11 in clang when building with Metal

The example code that uses Metal forces C++11 features, therefore
we have to turn it on clang so that we can enable the building of
compatible code that can be used by Metal and GL at the same time.
This commit is contained in:
George ElKoura 2019-03-09 11:32:18 -08:00
parent 6ff680f34e
commit 45a03a460b

View File

@ -407,6 +407,12 @@ endif()
if( METAL_FOUND AND NOT NO_METAL) if( METAL_FOUND AND NOT NO_METAL)
set(OSD_GPU TRUE) 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() endif()
if( OPENGL_FOUND AND NOT NO_OPENGL) if( OPENGL_FOUND AND NOT NO_OPENGL)