Skip to content

Commit

Permalink
WASM: Define LPYTHON_BUILD_TO_WASM and set HAVE_BUILD_TO_WASM in CMak…
Browse files Browse the repository at this point in the history
…eLists.txt
  • Loading branch information
Shaikh-Ubaid committed Aug 25, 2022
1 parent 3d8295f commit 491dd75
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ set(WITH_RUNTIME_LIBRARY YES
set(WITH_INTRINSIC_MODULES no
CACHE BOOL "Compile intrinsic modules to .pyc (ASR) at build time")

# Build to wasm
set(LPYTHON_BUILD_TO_WASM no
CACHE BOOL "Compile LPython To WASM")

if (LPYTHON_BUILD_TO_WASM)
set(HAVE_BUILD_TO_WASM yes)
add_definitions("-DHAVE_BUILD_TO_WASM=1")
endif()

# Find ZLIB with our custom finder before including LLVM since the finder for LLVM
# might search for ZLIB again and find the shared libraries instead of the static ones
find_package(StaticZLIB REQUIRED)
Expand Down Expand Up @@ -257,6 +266,7 @@ endif ()
message("Installation prefix: ${CMAKE_INSTALL_PREFIX}")
message("WITH_LFORTRAN_ASSERT: ${WITH_LFORTRAN_ASSERT}")
message("LPYTHON_STATIC_BIN: ${LPYTHON_STATIC_BIN}")
message("LPYTHON_BUILD_TO_WASM: ${LPYTHON_BUILD_TO_WASM}")
message("WITH_STACKTRACE: ${WITH_STACKTRACE}")
message("WITH_UNWIND: ${WITH_UNWIND}")
message("WITH_BFD: ${WITH_BFD}")
Expand Down

0 comments on commit 491dd75

Please sign in to comment.