mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
[MPS] Do not pass linker command to a compiler (#78630)
`-weak_framework` is a linker rather than a compiler option and as such it should not be passed as CXX flag Also, use `string(APPEND` rather than `set(FOO "$(FOO) ...)` Likely fixes our ability to use `sccache` for MacOS CI builds, see https://github.com/pytorch/pytorch/issues/78375#issuecomment-1143697183 Pull Request resolved: https://github.com/pytorch/pytorch/pull/78630 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
ca7f948806
commit
634954c55c
@ -947,7 +947,8 @@ endif()
|
||||
|
||||
if(APPLE)
|
||||
if(USE_MPS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_MPS -fno-objc-arc -weak_framework Foundation -weak_framework MetalPerformanceShaders -weak_framework MetalPerformanceShadersGraph -weak_framework Metal")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -DUSE_MPS -fno-objc-arc")
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -weak_framework Foundation -weak_framework MetalPerformanceShaders -weak_framework MetalPerformanceShadersGraph -weak_framework Metal")
|
||||
endif()
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-unused-private-field")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -Wno-missing-braces")
|
||||
|
Reference in New Issue
Block a user