mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-09-11 05:35:33 +03:00
Modified wasm cmake file to include version information in built artifacts
This commit is contained in:
parent
c44868e1fd
commit
2e5880d3d4
@ -4,6 +4,10 @@ add_executable(bergamot-translator-worker
|
||||
bindings/TranslationResultBindings.cpp
|
||||
)
|
||||
|
||||
# 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)
|
||||
|
||||
# This header inclusion needs to go away later as path to public headers of bergamot
|
||||
# translator should be directly available from "bergamot-translator" target
|
||||
target_include_directories(bergamot-translator-worker
|
||||
@ -19,6 +23,9 @@ set(LINKER_FLAGS "-g2 --bind -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=1 -s
|
||||
# Avoid node.js-code in emscripten glue-code
|
||||
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_target_properties(bergamot-translator-worker PROPERTIES
|
||||
SUFFIX ".js"
|
||||
LINK_FLAGS ${LINKER_FLAGS}
|
||||
|
1
wasm/project_version.js.in
Normal file
1
wasm/project_version.js.in
Normal file
@ -0,0 +1 @@
|
||||
var BERGAMOT_VERSION_FULL = "@PROJECT_VERSION_STRING_FULL@";
|
Loading…
Reference in New Issue
Block a user