Skip to content

Commit

Permalink
[MPS] Link essential libraries in cmake (#8230)
Browse files Browse the repository at this point in the history
Fixes #8222

I think we don't have tests for cmake build. It was built successfully on my Mac.
  • Loading branch information
qqaatw authored Jan 30, 2024
1 parent 432283c commit 0be6c7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ ENDFOREACH()
add_library(${PROJECT_NAME} SHARED ${ALL_SOURCES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${TORCH_LIBRARIES})

if(WITH_MPS)
find_library(metal NAMES Metal)
find_library(foundation NAMES Foundation)
target_link_libraries(${PROJECT_NAME} PRIVATE ${metal} ${foundation})
endif()

if (WITH_PNG)
target_link_libraries(${PROJECT_NAME} PRIVATE ${PNG_LIBRARY})
endif()
Expand Down

0 comments on commit 0be6c7e

Please sign in to comment.