aboutsummaryrefslogtreecommitdiff
path: root/Android.bp
blob: 7771723b3bc36a95a5dd5f883ebe142bf14323a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
cc_library_static {
    name: "libsfntly",
    host_supported: true,
    srcs: [
        "cpp/src/sfntly/*.cc",
        "cpp/src/sfntly/data/*.cc",
        "cpp/src/sfntly/port/*.cc",
        "cpp/src/sfntly/table/**/*.cc",
        "cpp/src/sample/chromium/font_subsetter.cc",
        "cpp/src/sample/chromium/subsetter_impl.cc",
    ],

    cflags: [
        "-fstack-protector",
        "--param=ssp-buffer-size=4",
        "-Werror",
        "-fno-exceptions",
        "-fno-strict-aliasing",
        "-Wall",
        "-Wno-unused-parameter",
        "-Wno-missing-field-initializers",
        "-fvisibility=hidden",
        "-fno-tree-sra",
        "-Wno-psabi",
        "-ffunction-sections",
        "-funwind-tables",
        "-g",
        "-fno-short-enums",
        "-finline-limit=64",
        "-Wa,--noexecstack",
        "-U_FORTIFY_SOURCE",
        "-Wno-extra",
        "-Wno-ignored-qualifiers",
        "-Wno-type-limits",
        "-Os",
        "-fno-ident",
        "-fdata-sections",
        "-ffunction-sections",
        "-fomit-frame-pointer",

        "-DANGLE_DX11",
        "-D_FILE_OFFSET_BITS=64",
        "-DNO_TCMALLOC",
        "-DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY",
        "-DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE",
        "-DDISABLE_NACL",
        "-DCHROMIUM_BUILD",
        "-DUSE_LIBJPEG_TURBO=1",
        "-DUSE_PROPRIETARY_CODECS",
        "-DENABLE_CONFIGURATION_POLICY",
        "-DENABLE_GPU=1",
        "-DUSE_OPENSSL=1",
        "-DENABLE_EGLIMAGE=1",
        "-DSFNTLY_NO_EXCEPTION",
        "-DU_USING_ICU_NAMESPACE=0",
        "-D__STDC_CONSTANT_MACROS",
        "-D__STDC_FORMAT_MACROS",
        "-DANDROID",
        "-D__GNU_SOURCE=1",
        "-D_STLP_USE_PTR_SPECIALIZATIONS=1",
        "-DCHROME_BUILD_ID='\"\"'",
        "-DNDEBUG",
        "-DNVALGRIND",
        "-DDYNAMIC_ANNOTATIONS_ENABLED=0",
        "-D_FORTIFY_SOURCE=2",
    ],

    cppflags: [
        "-fno-threadsafe-statics",
        "-fvisibility-inlines-hidden",
        "-Wsign-compare",
        "-Wno-abi",
        "-Wno-error=c++0x-compat",
        "-Wno-non-virtual-dtor",
        "-Wno-sign-promo",
    ],

    debug: {
        cflags: [
            "-UNDEBUG",
            "-UNVALGRIND",
            "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
            "-DWTF_USE_DYNAMIC_ANNOTATIONS=1",
            "-D_DEBUG",
        ],
    },

    export_include_dirs: ["cpp/src"],

    target: {
        android: {
            cflags: ["-fPIC"],
            shared_libs: ["libandroidicu"],
        },
        host: {
            shared_libs: [
                "libicui18n",
                "libicuuc"
            ],
        },
        not_windows: {
            cflags: ["-fPIC"],
        },
        windows: {
            enabled: true,
            // "-fstack-protector" is not used by default on Windows, and enabling it
            // on one library only prevents this library from being linked successfully
            // when used as a dependency. So we disable it for Windows.
            cflags: ["-fno-stack-protector"],
        },
    },
}