Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/boost_headers.py
4133 views
1
# Copyright 2015 The Emscripten Authors. All rights reserved.
2
# Emscripten is available under two separate licenses, the MIT license and the
3
# University of Illinois/NCSA Open Source License. Both these licenses can be
4
# found in the LICENSE file.
5
6
import os
7
8
TAG = '1.83.0'
9
HASH = '82e3a64e55caac0254f9e6b179437ad9421943b8f73957285978dad16c24dcae6372c464909fdc085b9790662b6a3af5163140b1e456705e80fda51c5fe3c243'
10
11
12
def needed(settings):
13
return settings.USE_BOOST_HEADERS == 1
14
15
16
def get(ports, settings, shared):
17
ports.fetch_project('boost_headers',
18
f'https://github.com/emscripten-ports/boost/releases/download/boost-{TAG}/boost-headers-{TAG}.zip',
19
sha512hash=HASH)
20
21
def create(final):
22
# includes
23
source_path = ports.get_dir('boost_headers')
24
source_path_include = os.path.join(source_path, 'boost')
25
ports.install_header_dir(source_path_include, 'boost')
26
27
# write out a dummy cpp file, to create an empty library
28
# this is needed as emscripted ports expect this, even if it is not used
29
dummy_file = os.path.join(source_path, 'dummy.cpp')
30
shared.safe_ensure_dirs(os.path.dirname(dummy_file))
31
ports.write_file(dummy_file, 'static void dummy() {}')
32
33
ports.build_port(source_path, final, 'boost_headers', srcs=['dummy.cpp'])
34
35
return [shared.cache.get_lib('libboost_headers.a', create, what='port')]
36
37
38
def clear(ports, settings, shared):
39
shared.cache.erase_lib('libboost_headers.a')
40
41
42
def process_args(ports):
43
return ['-DBOOST_ALL_NO_LIB']
44
45
46
def show():
47
return f'boost_headers - Boost headers v{TAG} (-sUSE_BOOST_HEADERS=1 or --use-port=boost_headers; Boost license)'
48
49