MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / get

Function get

tools/ports/harfbuzz.py:81–141  ·  view source on GitHub ↗
(ports, settings, shared)

Source from the content-addressed store, hash-verified

79
80
81def get(ports, settings, shared):
82 ports.fetch_project('harfbuzz', f'https://github.com/harfbuzz/harfbuzz/releases/download/{VERSION}/harfbuzz-{VERSION}.tar.xz', sha512hash=HASH)
83
84 def create(final):
85 source_path = ports.get_dir('harfbuzz', 'harfbuzz-' + VERSION)
86 freetype_include = ports.get_include_dir('freetype2')
87 ports.install_headers(os.path.join(source_path, 'src'), target='harfbuzz')
88
89 # TODO(sbc): Look into HB_TINY, HB_LEAN, HB_MINI options. Remove
90 # HAVE_MMAP/HAVE_MPROTECT/HAVE_SYSCONF since we don't really support those?
91
92 # These cflags are the ones that the cmake build selects when running emcmake
93 # with harfbuzz
94 cflags = '''
95 -DHAVE_FREETYPE
96 -DHAVE_ATEXIT
97 -DHAVE_FALLBACK
98 -DHAVE_FT_SET_VAR_BLEND_COORDINATES
99 -DHAVE_INTEL_ATOMIC_PRIMITIVES
100 -DHAVE_MMAP
101 -DHAVE_MPROTECT
102 -DHAVE_OT
103 -DHAVE_STRTOD_L
104 -DHAVE_SYSCONF
105 -DHAVE_UCDN
106 -DHAVE_UNIST_H
107 -DHAVE_XLOCALE_H
108 -DHAVE_SYS_MMAN_H
109 -DHAVE_UNISTD_H
110 -fno-rtti
111 -fno-exceptions
112 -O3
113 -DNDEBUG
114 -Wno-nontrivial-memaccess
115 '''.split()
116
117 cflags += ['-I' + freetype_include, '-I' + os.path.join(freetype_include, 'config')]
118
119 if settings.MAIN_MODULE:
120 cflags.append('-fPIC')
121
122 if settings.PTHREADS:
123 cflags.append('-pthread')
124 cflags.append('-DHAVE_PTHREAD')
125 else:
126 cflags.append('-DHB_NO_MT')
127
128 # Letting HarfBuzz enable warnings through pragmas can block compiler
129 # upgrades in situations where say a ToT compiler build adds a new
130 # stricter warning under -Wfoowarning-subgroup. HarfBuzz pragma-enables
131 # -Wfoowarning which default-enables -Wfoowarning-subgroup implicitly but
132 # HarfBuzz upstream is not yet clean of warnings produced for
133 # -Wfoowarning-subgroup. Hence disabling pragma warning control here.
134 # See also: https://github.com/emscripten-core/emscripten/pull/18119
135 cflags.append('-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_ERROR')
136 cflags.append('-DHB_NO_PRAGMA_GCC_DIAGNOSTIC_WARNING')
137
138 ports.make_pkg_config('harfbuzz', VERSION, '-sUSE_HARFBUZZ')

Callers

nothing calls this directly

Calls 2

fetch_projectMethod · 0.80
get_lib_nameFunction · 0.70

Tested by

no test coverage detected