Skip to content

Commit

Permalink
Build barretenberg's primitives.wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Apr 6, 2023
1 parent 2d4873c commit b72a5ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cpp/cmake/barretenberg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ include(ExternalProject)
# Reference barretenberg artifacts (like library archives) via this dir:
if (WASM)
set(BBERG_BUILD_DIR ${BBERG_DIR}/build-wasm)
set(BBERG_TARGETS --target barretenberg --target env --target primitives.wasm)
else()
set(BBERG_BUILD_DIR ${BBERG_DIR}/build)
set(BBERG_TARGETS --target barretenberg --target env)
endif()

if(NOT CMAKE_BBERG_PRESET)
Expand All @@ -32,7 +34,7 @@ ExternalProject_Add(Barretenberg
UPDATE_COMMAND ""
INSTALL_COMMAND ""
CONFIGURE_COMMAND ${CMAKE_COMMAND} --preset ${CMAKE_BBERG_PRESET} -DSERIALIZE_CANARY=${SERIALIZE_CANARY} -DENABLE_ASAN=${ENABLE_ASAN} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} --target barretenberg --target env
BUILD_COMMAND ${CMAKE_COMMAND} --build --preset ${CMAKE_BBERG_PRESET} ${BBERG_TARGETS}
# byproducts needed by ninja generator (not needed by make)
BUILD_BYPRODUCTS ${BBERG_BUILD_DIR}/lib/libbarretenberg.a ${BBERG_BUILD_DIR}/lib/libenv.a)

Expand Down
1 change: 1 addition & 0 deletions cpp/dockerfiles/Dockerfile.wasm-linux-clang
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ RUN cmake --preset wasm && cmake --build --preset wasm

FROM alpine:3.17
COPY --from=builder /usr/src/aztec3-circuits/cpp/build-wasm/bin/aztec3-circuits.wasm /usr/src/aztec3-circuits/cpp/build-wasm/bin/aztec3-circuits.wasm
COPY --from=builder /usr/src/aztec3-circuits/cpp/barretenberg/cpp/build-wasm/bin/primitives.wasm /usr/src/aztec3-circuits/cpp/barretenberg/cpp/build-wasm/bin/primitives.wasm
COPY --from=builder /usr/src/aztec3-circuits/cpp/barretenberg/cpp/srs_db /usr/src/aztec3-circuits/cpp/barretenberg/cpp/srs_db

0 comments on commit b72a5ac

Please sign in to comment.