|
| 1 | +package { |
| 2 | + default_applicable_licenses: [ |
| 3 | + "external_realm_license", |
| 4 | + "external_realm_dep_intel_math_library_license", |
| 5 | + "external_realm_dep_mpark_variant_license", |
| 6 | + "external_realm_dep_nlohmann_json_license", |
| 7 | + "external_realm_dep_s2_license", |
| 8 | + ], |
| 9 | +} |
| 10 | + |
| 11 | +license { |
| 12 | + name: "external_realm_license", |
| 13 | + visibility: [":__subpackages__"], |
| 14 | + license_kinds: [ |
| 15 | + "SPDX-license-identifier-Apache-2.0", |
| 16 | + ], |
| 17 | + license_text: [ |
| 18 | + "LICENSE", |
| 19 | + ], |
| 20 | +} |
| 21 | + |
| 22 | +license { |
| 23 | + name: "external_realm_dep_intel_math_library_license", |
| 24 | + visibility: [":__subpackages__"], |
| 25 | + license_kinds: [ |
| 26 | + "legacy_notice", |
| 27 | + ], |
| 28 | + license_text: [ |
| 29 | + "src/external/IntelRDFPMathLib20U2/eula.txt", |
| 30 | + ], |
| 31 | +} |
| 32 | + |
| 33 | +license { |
| 34 | + name: "external_realm_dep_mpark_variant_license", |
| 35 | + visibility: [":__subpackages__"], |
| 36 | + license_kinds: [ |
| 37 | + "SPDX-license-identifier-BSL-1.0", |
| 38 | + ], |
| 39 | + license_text: [ |
| 40 | + "src/external/mpark/LICENSE.md", |
| 41 | + ], |
| 42 | +} |
| 43 | + |
| 44 | +license { |
| 45 | + name: "external_realm_dep_nlohmann_json_license", |
| 46 | + visibility: [":__subpackages__"], |
| 47 | + license_kinds: [ |
| 48 | + "SPDX-license-identifier-MIT", |
| 49 | + ], |
| 50 | + license_text: [ |
| 51 | + "src/external/json/LICENSE.MIT", |
| 52 | + ], |
| 53 | +} |
| 54 | + |
| 55 | +license { |
| 56 | + name: "external_realm_dep_s2_license", |
| 57 | + visibility: [":__subpackages__"], |
| 58 | + license_kinds: [ |
| 59 | + "SPDX-license-identifier-Apache-2.0", |
| 60 | + ], |
| 61 | + license_text: [ |
| 62 | + "src/external/s2/LICENSE-2.0.txt", |
| 63 | + ], |
| 64 | +} |
| 65 | + |
| 66 | +cc_object { |
| 67 | + name: "IntelRDFPMathLib20U2", |
| 68 | + srcs: [ |
| 69 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c", |
| 70 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c", |
| 71 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c", |
| 72 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c", |
| 73 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c", |
| 74 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c", |
| 75 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c", |
| 76 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c", |
| 77 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c", |
| 78 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c", |
| 79 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c", |
| 80 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c", |
| 81 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c", |
| 82 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c", |
| 83 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c", |
| 84 | + "src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c", |
| 85 | + ], |
| 86 | +} |
| 87 | + |
| 88 | +cc_object { |
| 89 | + name: "s2", |
| 90 | + srcs: ["src/external/s2/**/*.cc"], |
| 91 | + defaults: [ |
| 92 | + "realm_consumer_defaults", |
| 93 | + "realm_defaults", |
| 94 | + ], |
| 95 | + local_include_dirs: [ |
| 96 | + "src", |
| 97 | + "src/external", |
| 98 | + "src/external/s2", |
| 99 | + ], |
| 100 | + cflags: [ |
| 101 | + "-Wno-deprecated-declarations", |
| 102 | + "-Wno-ignored-qualifiers", |
| 103 | + "-Wno-macro-redefined", |
| 104 | + "-Wno-missing-prototypes", |
| 105 | + "-Wno-shorten-64-to-32", |
| 106 | + "-Wno-undefined-var-template", |
| 107 | + "-Wno-unknown-pragmas", |
| 108 | + "-Wno-unused-const-variable", |
| 109 | + "-Wno-unused-function", |
| 110 | + "-Wno-unused-local-typedefs", |
| 111 | + "-Wno-unused-parameter", |
| 112 | + ], |
| 113 | +} |
| 114 | + |
| 115 | +genrule { |
| 116 | + name: "version_numbers.hpp", |
| 117 | + srcs: [ |
| 118 | + "dependencies.list", |
| 119 | + "src/realm/version_numbers.hpp.in", |
| 120 | + ], |
| 121 | + out: ["realm/version_numbers.hpp"], |
| 122 | + tool_files: ["tools/generate-version-numbers-for-soong.sh"], |
| 123 | + cmd: "$(location) $(in) > $(out)", |
| 124 | +} |
| 125 | + |
| 126 | +cc_defaults { |
| 127 | + name: "realm_consumer_defaults", |
| 128 | + cpp_std: "c++17", |
| 129 | + rtti: true, |
| 130 | + cppflags: [ |
| 131 | + "-fexceptions", |
| 132 | + ], |
| 133 | + debug: { |
| 134 | + cflags: ["-DREALM_DEBUG"], |
| 135 | + }, |
| 136 | + shared_libs: [ |
| 137 | + "liblog", |
| 138 | + "libandroid", |
| 139 | + "libz", |
| 140 | + "libcrypto", |
| 141 | + "libssl", |
| 142 | + ], |
| 143 | +} |
| 144 | + |
| 145 | +cc_defaults { |
| 146 | + name: "realm_defaults", |
| 147 | + cflags: [ |
| 148 | + "-fPIC", |
| 149 | + "-DREALM_NO_CONFIG", |
| 150 | + "-DREALM_HAVE_OPENSSL=1", |
| 151 | + "-DREALM_ENABLE_ENCRYPTION=1", |
| 152 | + "-DREALM_ENABLE_SYNC=1", |
| 153 | + "-DREALM_ENABLE_GEOSPATIAL=1", |
| 154 | + "-DREALM_HAVE_EPOLL=1", |
| 155 | + "-Wno-non-virtual-dtor", |
| 156 | + "-Wno-missing-field-initializers", |
| 157 | + ], |
| 158 | + lto: { |
| 159 | + thin: true, |
| 160 | + }, |
| 161 | + include_build_directory: false, |
| 162 | + generated_headers: ["version_numbers.hpp"], |
| 163 | +} |
| 164 | + |
| 165 | +cc_library_static { |
| 166 | + name: "realm", |
| 167 | + defaults: [ |
| 168 | + "realm_consumer_defaults", |
| 169 | + "realm_defaults", |
| 170 | + ], |
| 171 | + cflags: [ |
| 172 | + "-fvisibility=hidden", |
| 173 | + ], |
| 174 | + local_include_dirs: ["src/external"], |
| 175 | + export_include_dirs: ["src"], |
| 176 | + export_generated_headers: ["version_numbers.hpp"], |
| 177 | + srcs: [ |
| 178 | + ":IntelRDFPMathLib20U2", |
| 179 | + ":s2", |
| 180 | + "src/realm/**/*.cpp", |
| 181 | + ], |
| 182 | + exclude_srcs: [ |
| 183 | + "src/realm/tools/**/*", |
| 184 | + "src/realm/exec/**/*", |
| 185 | + "src/realm/sync/tools/**/*", |
| 186 | + "src/realm/object-store/c_api/**/*", |
| 187 | + "src/realm/object-store/impl/apple/**/*", |
| 188 | + "src/realm/object-store/impl/emscripten/**/*", |
| 189 | + "src/realm/object-store/impl/generic/**/*", |
| 190 | + "src/realm/object-store/impl/windows/**/*", |
| 191 | + "src/realm/object-store/sync/impl/emscripten/**/*", |
| 192 | + ], |
| 193 | + export_shared_lib_headers: ["libcrypto"], |
| 194 | +} |
0 commit comments