Skip to content

Commit

Permalink
Generating cmake configured project version (.js) file in build folder (
Browse files Browse the repository at this point in the history
#194)

- Earlier this file was being generated in folder containing
   actual sources

 - Fixes #161
  • Loading branch information
abhi-agg committed Jun 9, 2021
1 parent 3039dea commit 16eb47f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wasm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_executable(bergamot-translator-worker

# Generate version file that can be included in the wasm artifacts
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project_version.js.in
${CMAKE_CURRENT_SOURCE_DIR}/project_version.js @ONLY)
${CMAKE_CURRENT_BINARY_DIR}/project_version.js @ONLY)

# This header inclusion needs to go away later as path to public headers of bergamot
# translator should be directly available from "bergamot-translator" target
Expand All @@ -24,7 +24,7 @@ set(LINKER_FLAGS "-g2 --bind -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=1 -s
set(LINKER_FLAGS "${LINKER_FLAGS} -s ENVIRONMENT=web,worker")

# Append version information in the Javascript artifact
set(LINKER_FLAGS "${LINKER_FLAGS} --extern-pre-js ${CMAKE_CURRENT_SOURCE_DIR}/project_version.js")
set(LINKER_FLAGS "${LINKER_FLAGS} --extern-pre-js ${CMAKE_CURRENT_BINARY_DIR}/project_version.js")

set_target_properties(bergamot-translator-worker PROPERTIES
SUFFIX ".js"
Expand Down

0 comments on commit 16eb47f

Please sign in to comment.