Bob Badour | 2af4d57 | 2021-02-12 18:00:01 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_sfntly_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change that took the approach of |
| 6 | // 'apply every license found to every target'. While this makes sure we respect |
| 7 | // every license restriction, it may not be entirely correct. |
| 8 | // |
| 9 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 10 | // |
| 11 | // Please consider splitting the single license below into multiple licenses, |
| 12 | // taking care not to lose any license_kind information, and overriding the |
| 13 | // default license using the 'licenses: [...]' property on targets as needed. |
| 14 | // |
| 15 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 16 | // to attach the license to, and including a comment whether the files may be |
| 17 | // used in the current project. |
| 18 | // See: http://go/android-license-faq |
| 19 | license { |
| 20 | name: "external_sfntly_license", |
| 21 | visibility: [":__subpackages__"], |
| 22 | license_kinds: [ |
| 23 | "SPDX-license-identifier-Apache-2.0", |
| 24 | "SPDX-license-identifier-Zlib", |
| 25 | ], |
| 26 | license_text: [ |
| 27 | "cpp/COPYING.txt", |
| 28 | ], |
| 29 | } |
| 30 | |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 31 | cc_library_static { |
| 32 | name: "libsfntly", |
Jerome Gaillard | 2e0c371 | 2018-07-10 16:08:14 +0100 | [diff] [blame] | 33 | host_supported: true, |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 34 | srcs: [ |
Haibo Huang | 29d542f | 2019-05-03 15:19:10 -0700 | [diff] [blame] | 35 | "cpp/src/sfntly/*.cc", |
| 36 | "cpp/src/sfntly/data/*.cc", |
| 37 | "cpp/src/sfntly/port/*.cc", |
| 38 | "cpp/src/sfntly/table/**/*.cc", |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 39 | "cpp/src/sample/chromium/font_subsetter.cc", |
| 40 | "cpp/src/sample/chromium/subsetter_impl.cc", |
| 41 | ], |
| 42 | |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 43 | cflags: [ |
| 44 | "-fstack-protector", |
| 45 | "--param=ssp-buffer-size=4", |
| 46 | "-Werror", |
| 47 | "-fno-exceptions", |
| 48 | "-fno-strict-aliasing", |
| 49 | "-Wall", |
| 50 | "-Wno-unused-parameter", |
| 51 | "-Wno-missing-field-initializers", |
| 52 | "-fvisibility=hidden", |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 53 | "-fno-tree-sra", |
| 54 | "-Wno-psabi", |
| 55 | "-ffunction-sections", |
| 56 | "-funwind-tables", |
| 57 | "-g", |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 58 | "-fno-short-enums", |
| 59 | "-finline-limit=64", |
| 60 | "-Wa,--noexecstack", |
| 61 | "-U_FORTIFY_SOURCE", |
| 62 | "-Wno-extra", |
| 63 | "-Wno-ignored-qualifiers", |
| 64 | "-Wno-type-limits", |
| 65 | "-Os", |
| 66 | "-fno-ident", |
| 67 | "-fdata-sections", |
| 68 | "-ffunction-sections", |
| 69 | "-fomit-frame-pointer", |
| 70 | |
| 71 | "-DANGLE_DX11", |
| 72 | "-D_FILE_OFFSET_BITS=64", |
| 73 | "-DNO_TCMALLOC", |
| 74 | "-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY", |
| 75 | "-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE", |
| 76 | "-DDISABLE_NACL", |
| 77 | "-DCHROMIUM_BUILD", |
| 78 | "-DUSE_LIBJPEG_TURBO=1", |
| 79 | "-DUSE_PROPRIETARY_CODECS", |
| 80 | "-DENABLE_CONFIGURATION_POLICY", |
| 81 | "-DENABLE_GPU=1", |
| 82 | "-DUSE_OPENSSL=1", |
| 83 | "-DENABLE_EGLIMAGE=1", |
| 84 | "-DSFNTLY_NO_EXCEPTION", |
| 85 | "-DU_USING_ICU_NAMESPACE=0", |
| 86 | "-D__STDC_CONSTANT_MACROS", |
| 87 | "-D__STDC_FORMAT_MACROS", |
| 88 | "-DANDROID", |
| 89 | "-D__GNU_SOURCE=1", |
| 90 | "-D_STLP_USE_PTR_SPECIALIZATIONS=1", |
| 91 | "-DCHROME_BUILD_ID='\"\"'", |
| 92 | "-DNDEBUG", |
| 93 | "-DNVALGRIND", |
| 94 | "-DDYNAMIC_ANNOTATIONS_ENABLED=0", |
| 95 | "-D_FORTIFY_SOURCE=2", |
| 96 | ], |
| 97 | |
| 98 | cppflags: [ |
| 99 | "-fno-threadsafe-statics", |
| 100 | "-fvisibility-inlines-hidden", |
| 101 | "-Wsign-compare", |
| 102 | "-Wno-abi", |
| 103 | "-Wno-error=c++0x-compat", |
| 104 | "-Wno-non-virtual-dtor", |
| 105 | "-Wno-sign-promo", |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 106 | ], |
| 107 | |
| 108 | debug: { |
| 109 | cflags: [ |
| 110 | "-UNDEBUG", |
| 111 | "-UNVALGRIND", |
| 112 | "-DDYNAMIC_ANNOTATIONS_ENABLED=1", |
| 113 | "-DWTF_USE_DYNAMIC_ANNOTATIONS=1", |
| 114 | "-D_DEBUG", |
| 115 | ], |
| 116 | }, |
| 117 | |
| 118 | export_include_dirs: ["cpp/src"], |
Jerome Gaillard | 8b95872 | 2019-01-11 17:16:34 +0000 | [diff] [blame] | 119 | |
| 120 | target: { |
| 121 | android: { |
| 122 | cflags: ["-fPIC"], |
Neil Fuller | 875956a | 2019-05-07 20:36:44 +0100 | [diff] [blame] | 123 | shared_libs: ["libandroidicu"], |
| 124 | }, |
| 125 | host: { |
| 126 | shared_libs: [ |
| 127 | "libicui18n", |
| 128 | "libicuuc" |
| 129 | ], |
Jerome Gaillard | 8b95872 | 2019-01-11 17:16:34 +0000 | [diff] [blame] | 130 | }, |
| 131 | not_windows: { |
| 132 | cflags: ["-fPIC"], |
| 133 | }, |
| 134 | windows: { |
| 135 | enabled: true, |
Jerome Gaillard | 8f57459 | 2019-01-17 15:34:59 +0000 | [diff] [blame] | 136 | // "-fstack-protector" is not used by default on Windows, and enabling it |
| 137 | // on one library only prevents this library from being linked successfully |
| 138 | // when used as a dependency. So we disable it for Windows. |
| 139 | cflags: ["-fno-stack-protector"], |
Jerome Gaillard | 8b95872 | 2019-01-11 17:16:34 +0000 | [diff] [blame] | 140 | }, |
| 141 | }, |
Colin Cross | f2f4c6f | 2016-12-01 18:03:32 -0800 | [diff] [blame] | 142 | } |