|
| 1 | +load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target") |
| 2 | +load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library") |
| 3 | +load("@fbsource//xplat/folly:defs.bzl", "folly_xplat_library") |
| 4 | +load("@fbsource//xplat/pfh/triage_InfrastructureSupermoduleOptou:DEFS.bzl", "triage_InfrastructureSupermoduleOptou") |
| 5 | + |
| 6 | +oncall("fbcode_entropy_wardens_folly") |
| 7 | + |
| 8 | +# Here are rules which conditionally provide exported-deps on other libraries, |
| 9 | +# encapsulating the conditional logic via select's. |
| 10 | +# |
| 11 | +# This enables other rules across folly which may need these deps to extract the |
| 12 | +# complexity to here and to take simple deps on the rules here. |
| 13 | + |
| 14 | +# xplat build rules |
| 15 | + |
| 16 | +non_fbcode_target( |
| 17 | + _kind = folly_xplat_library, |
| 18 | + name = "libdwarf", |
| 19 | + feature = triage_InfrastructureSupermoduleOptou, |
| 20 | + exported_deps = select({ |
| 21 | + "DEFAULT": [], |
| 22 | + "ovr_config//os:linux": [ |
| 23 | + "//third-party/libdwarf:dwarf", |
| 24 | + ], |
| 25 | + }), |
| 26 | +) |
| 27 | + |
| 28 | +non_fbcode_target( |
| 29 | + _kind = folly_xplat_library, |
| 30 | + name = "libunwind", |
| 31 | + feature = triage_InfrastructureSupermoduleOptou, |
| 32 | + exported_deps = select({ |
| 33 | + "DEFAULT": [], |
| 34 | + "ovr_config//os:linux": [ |
| 35 | + ":libunwind-linux", |
| 36 | + ], |
| 37 | + }), |
| 38 | +) |
| 39 | + |
| 40 | +non_fbcode_target( |
| 41 | + _kind = folly_xplat_library, |
| 42 | + name = "libunwind-linux", |
| 43 | + feature = triage_InfrastructureSupermoduleOptou, |
| 44 | + exported_deps = select({ |
| 45 | + "DEFAULT": [ |
| 46 | + "//third-party/libunwind:unwind", |
| 47 | + ], |
| 48 | + # anywhere-linux links in a different version of libunwind, do not use for now |
| 49 | + "ovr_config//runtime:anywhere-linux": [], |
| 50 | + }), |
| 51 | +) |
| 52 | + |
| 53 | +# fbcode build rules |
| 54 | + |
| 55 | +fbcode_target( |
| 56 | + _kind = cpp_library, |
| 57 | + name = "libdwarf", |
| 58 | + exported_deps = [ |
| 59 | + "fbsource//third-party/libdwarf:dwarf", |
| 60 | + ], |
| 61 | +) |
| 62 | + |
| 63 | +fbcode_target( |
| 64 | + _kind = cpp_library, |
| 65 | + name = "libunwind", |
| 66 | + exported_deps = select({ |
| 67 | + "DEFAULT": [], |
| 68 | + "ovr_config//os:linux": [ |
| 69 | + ":libunwind-linux", |
| 70 | + ], |
| 71 | + }), |
| 72 | +) |
| 73 | + |
| 74 | +fbcode_target( |
| 75 | + _kind = cpp_library, |
| 76 | + name = "libunwind-linux", |
| 77 | + exported_deps = [ |
| 78 | + "fbsource//third-party/libunwind:unwind", |
| 79 | + ], |
| 80 | +) |
0 commit comments