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

Function get

tools/ports/sqlite3.py:23–72  ·  view source on GitHub ↗
(ports, settings, shared)

Source from the content-addressed store, hash-verified

21
22
23def get(ports, settings, shared):
24 release = f'sqlite-amalgamation-{VERSION[0]}{VERSION[1]:02}{VERSION[2]:02}00'
25 # TODO: Fetch the file from an emscripten-hosted mirror.
26 ports.fetch_project('sqlite3', f'https://www.sqlite.org/{VERSION_YEAR}/{release}.zip', sha512hash=HASH)
27
28 def create(final):
29 source_path = ports.get_dir('sqlite3', release)
30
31 ports.install_headers(source_path)
32 ports.make_pkg_config('sqlite', ','.join(str(v) for v in VERSION), '-sUSE_SQLITE3')
33
34 # flags are based on sqlite-autoconf output.
35 # SQLITE_HAVE_ZLIB is only used by shell.c
36 flags = [
37 '-DSTDC_HEADERS=1',
38 '-DHAVE_SYS_TYPES_H=1',
39 '-DHAVE_SYS_STAT_H=1',
40 '-DHAVE_STDLIB_H=1',
41 '-DHAVE_STRING_H=1',
42 '-DHAVE_MEMORY_H=1',
43 '-DHAVE_STRINGS_H=1',
44 '-DHAVE_INTTYPES_H=1',
45 '-DHAVE_STDINT_H=1',
46 '-DHAVE_UNISTD_H=1',
47 '-DHAVE_FDATASYNC=1',
48 '-DHAVE_USLEEP=1',
49 '-DHAVE_LOCALTIME_R=1',
50 '-DHAVE_GMTIME_R=1',
51 '-DHAVE_DECL_STRERROR_R=1',
52 '-DHAVE_STRERROR_R=1',
53 '-DHAVE_POSIX_FALLOCATE=1',
54 '-DSQLITE_OMIT_LOAD_EXTENSION=1',
55 '-DSQLITE_ENABLE_MATH_FUNCTIONS=1',
56 '-DSQLITE_ENABLE_FTS4=1',
57 '-DSQLITE_ENABLE_FTS5=1',
58 '-DSQLITE_ENABLE_RTREE=1',
59 '-DSQLITE_ENABLE_GEOPOLY=1',
60 '-DSQLITE_OMIT_POPEN=1',
61 ]
62 if settings.PTHREADS:
63 flags += [
64 '-pthread',
65 '-DSQLITE_THREADSAFE=1',
66 ]
67 else:
68 flags += ['-DSQLITE_THREADSAFE=0']
69
70 ports.build_port(source_path, final, 'sqlite3', flags=flags, exclude_files=['shell.c'])
71
72 return [shared.cache.get_lib(get_lib_name(settings), create, what='port')]
73
74
75def clear(ports, settings, shared):

Callers

nothing calls this directly

Calls 2

fetch_projectMethod · 0.80
get_lib_nameFunction · 0.70

Tested by

no test coverage detected