CMake files base setup for Metal

This commit is contained in:
Jake Turner
2022-02-09 20:28:05 +00:00
committed by Baldur Karlsson
parent 31221a6d04
commit ce36cc340f
4 changed files with 29 additions and 0 deletions
+9
View File
@@ -180,6 +180,7 @@ option(ENABLE_GL "Enable GL driver" ON)
option(ENABLE_GLES "Enable GL ES driver" ON)
option(ENABLE_EGL "Enable EGL" ON)
option(ENABLE_VULKAN "Enable Vulkan driver" ON)
option(ENABLE_METAL "Enable Metal driver" OFF)
option(ENABLE_RENDERDOCCMD "Enable renderdoccmd" ON)
option(ENABLE_QRENDERDOC "Enable qrenderdoc" ON)
option(ENABLE_PYRENDERDOC "Enable renderdoc python modules" ON)
@@ -320,6 +321,10 @@ if(ENABLE_VULKAN)
add_definitions(-DRENDERDOC_SUPPORT_VULKAN)
endif()
if(ENABLE_METAL)
add_definitions(-DRENDERDOC_SUPPORT_METAL)
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower)
set(RELEASE_MODE 0)
@@ -472,6 +477,10 @@ if(ENABLE_VULKAN)
message(STATUS " - Vulkan")
endif()
if(ENABLE_METAL)
message(STATUS " - Metal")
endif()
if(UNIX AND NOT ANDROID AND NOT APPLE AND NOT ENABLE_GGP)
message(STATUS "Enabled Window System Support:")
+4
View File
@@ -84,6 +84,10 @@ if(ENABLE_VULKAN)
set(QMAKE_CXXFLAGS "${QMAKE_CXXFLAGS} -DRENDERDOC_SUPPORT_VULKAN")
endif()
if(ENABLE_METAL)
set(QMAKE_CXXFLAGS "${QMAKE_CXXFLAGS} -DRENDERDOC_SUPPORT_METAL")
endif()
if(APPLE)
set(QMAKE_RPATHDIR "@executable_path/../lib")
add_custom_command(OUTPUT RenderDoc.icns
+10
View File
@@ -37,6 +37,11 @@ elseif(APPLE)
find_library(OPENGL_LIBRARY OpenGL)
list(APPEND RDOC_LIBRARIES PRIVATE ${OPENGL_LIBRARY})
endif()
if(ENABLE_METAL)
find_library(METAL_LIBRARY Metal)
list(APPEND RDOC_LIBRARIES PRIVATE ${METAL_LIBRARY})
endif()
elseif(ENABLE_GGP)
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
@@ -486,6 +491,11 @@ endif()
set(renderdoc_objects)
if(ENABLE_METAL)
add_subdirectory(driver/metal)
list(APPEND renderdoc_objects $<TARGET_OBJECTS:rdoc_metal>)
endif()
if(ENABLE_GL OR ENABLE_GLES)
add_subdirectory(driver/gl)
list(APPEND renderdoc_objects $<TARGET_OBJECTS:rdoc_gl>)
+6
View File
@@ -0,0 +1,6 @@
set(sources )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
add_library(rdoc_metal OBJECT ${sources})
target_compile_definitions(rdoc_metal ${RDOC_DEFINITIONS})
target_include_directories(rdoc_metal ${RDOC_INCLUDES})