Skip to content

Commit

Permalink
libs: install in <sysroot>/lib/wasm32-wasi and copy imports appropria…
Browse files Browse the repository at this point in the history
…tely
  • Loading branch information
csegarragonz committed Feb 13, 2024
1 parent a61d8b0 commit 852fc4a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 10 additions & 2 deletions tasks/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
CMAKE_TOOLCHAIN_FILE,
FAASM_BUILD_ENV_DICT,
FAASM_NATIVE_DIR,
WASM_SYSROOT,
WASM_LIB_INSTALL,
)
from faasmtools.env import LLVM_VERSION, PROJ_ROOT
from os.path import exists, join
Expand All @@ -16,7 +16,7 @@ def build_faasm_lib(subdir, clean=False, native=False, shared=False):
Builds one of the libraries included in this repo
"""
work_dir = join(PROJ_ROOT, subdir)
install_dir = FAASM_NATIVE_DIR if native else WASM_SYSROOT
install_dir = FAASM_NATIVE_DIR if native else WASM_LIB_INSTALL

if native and shared:
build_dir = "build-native-shared"
Expand Down Expand Up @@ -67,3 +67,11 @@ def build_faasm_lib(subdir, clean=False, native=False, shared=False):

run("ninja", shell=True, cwd=build_dir, check=True)
run("ninja install", shell=True, cwd=build_dir, check=True)

# Copy imports into place for WASM libraries
if not native:
imports_file = "{}.imports".format(subdir)
src_imports = join(work_dir, imports_file)
dst_imports = join(install_dir, imports_file)
print("Copying {} to {}".format(src_imports, dst_imports))
run("cp {} {}".format(src_imports, dst_imports), check=True, shell=True)

0 comments on commit 852fc4a

Please sign in to comment.