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

Don't try to enable Metal on older Macs #1588

Merged
merged 1 commit into from
Jun 2, 2024
Merged
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
Only enable Metal Pipeline if the Metal framework is found
  • Loading branch information
dpogue committed Jun 2, 2024
commit 1826acfda1345a1b6014d474cea8d06550bf6019
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ find_package(ZLIB REQUIRED)

if(APPLE)
find_package(Security)
find_package(Metal)
elseif(UNIX)
find_package(LIBSECRET)
find_package(Uuid REQUIRED)
Expand All @@ -147,7 +148,7 @@ endif(PLASMA_EXTERNAL_RELEASE)
# Pipeline Renderers
cmake_dependent_option(PLASMA_PIPELINE_DX "Enable DirectX rendering pipeline?" ON "DirectX_FOUND" OFF)
cmake_dependent_option(PLASMA_PIPELINE_GL "Enable OpenGL rendering pipeline?" ON "TARGET epoxy::epoxy" OFF)
cmake_dependent_option(PLASMA_PIPELINE_METAL "Enable Metal rendering pipeline?" ON "APPLE" OFF)
cmake_dependent_option(PLASMA_PIPELINE_METAL "Enable Metal rendering pipeline?" ON "TARGET Metal::Metal" OFF)

if(PLASMA_PIPELINE_DX)
add_definitions(-DPLASMA_PIPELINE_DX)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfMetalPipeline/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ target_link_libraries(pfMetalPipeline
CoreLib
pnNucleusInc
plPipeline
"-framework Metal"
Metal::Metal
"-framework MetalPerformanceShaders"
PRIVATE
plStatusLog
Expand Down
17 changes: 17 additions & 0 deletions cmake/FindMetal.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include(FindPackageHandleStandardArgs)

find_library(
Metal_LIBRARY
NAMES Metal
)

find_package_handle_standard_args(Metal REQUIRED_VARS Metal_LIBRARY)

if(Metal_FOUND AND NOT TARGET Metal::Metal)
add_library(Metal::Metal INTERFACE IMPORTED)
set_target_properties(
Metal::Metal PROPERTIES
INTERFACE_LINK_LIBRARIES ${Metal_LIBRARY}
)
endif()

Loading