Skip to content

Commit 9a72503

Browse files
committed
Update on "Dtype selective build: enable in fbcode"
^ By removing `header_namespace` and depending on #include "selected_op_variants.h" instead of the full path #include <executorch/kernels/portable/cpu/selected_op_variants.h> Note: expose_operator_symbols=False only works in xplat, so add a failure message for that too. I don't think we should recommend for users to set it to true, as it prevents a library from linking multiple executorch_generated_libs (symbols will clash). Differential Revision: [D75082395](https://our.internmc.facebook.com/intern/diff/D75082395/) [ghstack-poisoned]
2 parents 2552c0b + 7766399 commit 9a72503

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shim_et/xplat/executorch/codegen/codegen.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def build_portable_lib(name, oplist_header_name, portable_header_lib, feature =
465465
# library, and it blocks users like unit tests to use kernel
466466
# implementation directly. So we enable this for xplat only.
467467
compiler_flags = ["-Wno-missing-prototypes"]
468-
if not expose_operator_symbols:
468+
if not expose_operator_symbols and is_xplat():
469469
# Removing '-fvisibility=hidden' exposes operator symbols.
470470
# This allows operators to be called outside of the kernel registry.
471471
compiler_flags += ["-fvisibility=hidden"]
@@ -510,7 +510,7 @@ def build_optimized_lib(name, oplist_header_name, portable_header_lib, feature =
510510
# library, and it blocks users like unit tests to use kernel
511511
# implementation directly. So we enable this for xplat only.
512512
compiler_flags = ["-Wno-missing-prototypes", "-Wno-pass-failed","-Wno-global-constructors","-Wno-shadow",]
513-
if not expose_operator_symbols:
513+
if not expose_operator_symbols and is_xplat():
514514
# Removing '-fvisibility=hidden' exposes operator symbols.
515515
# This allows operators to be called outside of the kernel registry.
516516
compiler_flags += ["-fvisibility=hidden"]

0 commit comments

Comments
 (0)