Path: blob/main/tools/ports/boost_headers.py
4133 views
# Copyright 2015 The Emscripten Authors. All rights reserved.1# Emscripten is available under two separate licenses, the MIT license and the2# University of Illinois/NCSA Open Source License. Both these licenses can be3# found in the LICENSE file.45import os67TAG = '1.83.0'8HASH = '82e3a64e55caac0254f9e6b179437ad9421943b8f73957285978dad16c24dcae6372c464909fdc085b9790662b6a3af5163140b1e456705e80fda51c5fe3c243'91011def needed(settings):12return settings.USE_BOOST_HEADERS == 1131415def get(ports, settings, shared):16ports.fetch_project('boost_headers',17f'https://github.com/emscripten-ports/boost/releases/download/boost-{TAG}/boost-headers-{TAG}.zip',18sha512hash=HASH)1920def create(final):21# includes22source_path = ports.get_dir('boost_headers')23source_path_include = os.path.join(source_path, 'boost')24ports.install_header_dir(source_path_include, 'boost')2526# write out a dummy cpp file, to create an empty library27# this is needed as emscripted ports expect this, even if it is not used28dummy_file = os.path.join(source_path, 'dummy.cpp')29shared.safe_ensure_dirs(os.path.dirname(dummy_file))30ports.write_file(dummy_file, 'static void dummy() {}')3132ports.build_port(source_path, final, 'boost_headers', srcs=['dummy.cpp'])3334return [shared.cache.get_lib('libboost_headers.a', create, what='port')]353637def clear(ports, settings, shared):38shared.cache.erase_lib('libboost_headers.a')394041def process_args(ports):42return ['-DBOOST_ALL_NO_LIB']434445def show():46return f'boost_headers - Boost headers v{TAG} (-sUSE_BOOST_HEADERS=1 or --use-port=boost_headers; Boost license)'474849