diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 04cedcc6722..d31a0c4a63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -531,6 +531,19 @@ mark_as_advanced( WITH_GPU_SHADER_BUILDER ) +# Metal + +if (APPLE) + option(WITH_METAL_BACKEND "Use Metal for graphics instead of (or as well as) OpenGL on macOS." OFF) + mark_as_advanced(WITH_METAL_BACKEND) +else() + set(WITH_METAL_BACKEND OFF) +endif() + +if (WITH_METAL_BACKEND) + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE) +endif() + if(WIN32) option(WITH_GL_ANGLE "Link with the ANGLE library, an OpenGL ES 2.0 implementation based on Direct3D, instead of the system OpenGL library." OFF) mark_as_advanced(WITH_GL_ANGLE) @@ -1275,6 +1288,16 @@ else() endif() #----------------------------------------------------------------------------- +# Configure Metal. +if (WITH_METAL_BACKEND) + add_definitions(-DWITH_METAL_BACKEND) + + # No need to add frameworks here, all the ones we need for Metal and + # Metal-OpenGL Interop are already being added by + # build_files/cmake/platform/platform_apple.cmake +endif() + +#----------------------------------------------------------------------------- # Configure OpenMP. if(WITH_OPENMP) if(NOT OPENMP_CUSTOM) |