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

Fix focus builds of macOS apps on apple silicon. (#96966) #107816

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 20 additions & 35 deletions c2_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -324,43 +324,28 @@ def get_c2_default_cxx_args():
)

def get_c2_aten_cpu_fbobjc_macosx_deps():
if is_focus_enabled():
# focus2 is broken when using platform deps (T80070498) so in the case
# where it's focus2 we just add fbgemm as a standard dep. Otherwise we
# use platform deps to select correctly for arm64.
return [
"fbsource//xplat/deeplearning/fbgemm:fbgemm",
"fbsource//xplat/caffe2:cpukernel_avx2",
]
else:
return select({
"DEFAULT": [],
"ovr_config//os:macos-x86_64": ["fbsource//xplat/deeplearning/fbgemm:fbgemm"],
}) if is_arvr_mode() else []
return select({
"DEFAULT": [],
"ovr_config//os:macos-x86_64": ["fbsource//xplat/deeplearning/fbgemm:fbgemm"],
}) if is_arvr_mode() else []

def get_c2_aten_cpu_fbobjc_macosx_platform_deps():
if is_focus_enabled():
# focus2 is broken when using platform deps (T80070498) so in the case
# where it's focus2 we just add fbgemm as a standard dep. Otherwise we
# use platform deps to select correctly for arm64.
return []
else:
return compose_platform_setting_list([
{
"cpu": "x86_64",
"flags": [
"fbsource//xplat/deeplearning/fbgemm:fbgemmAppleMac",
] + ([
"fbsource//xplat/caffe2:cpukernel_avx2AppleMac",
] if not is_arvr_mode() else []),
"os": "macosx",
},
{
"cpu": "arm64",
"flags": ["fbsource//xplat/third-party/XNNPACK:XNNPACKAppleMac"],
"os": "macosx",
},
])
return compose_platform_setting_list([
{
"cpu": "x86_64",
"flags": [
"fbsource//xplat/deeplearning/fbgemm:fbgemmAppleMac",
] + ([
"fbsource//xplat/caffe2:cpukernel_avx2AppleMac",
] if not is_arvr_mode() else []),
"os": "macosx",
},
{
"cpu": "arm64",
"flags": ["fbsource//xplat/third-party/XNNPACK:XNNPACKAppleMac"],
"os": "macosx",
},
])

def using_protobuf_v3():
# Consider migrating this to `read_config("protobuf", "use_v3")`
Expand Down