From ce01de939d8da7b054169e3a8b9fa20a89c9b8e5 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 10 May 2021 11:28:37 +0100 Subject: [PATCH] Change USE_WASM_COMPATIBLE_SOURCE =OFF by default on native, force on for WASM (#138) * Change WASM_COMPATIBLE_SOURCE=OFF by default The default was WASN_COMPATIBLE_SOURCE=ON COMPILE_WASM=OFF which is a testing configuration, not a sensible default for native or wasm. * Always USE_WASM_COMPATIBLE_SOURCE with COMPILE_WASM * Set CMP0077 to fix variable handling --- 3rd_party/marian-dev | 2 +- CMakeLists.txt | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/3rd_party/marian-dev b/3rd_party/marian-dev index ca15d61..03db505 160000 --- a/3rd_party/marian-dev +++ b/3rd_party/marian-dev @@ -1 +1 @@ -Subproject commit ca15d61c87ef2f8f2c290b75a5da6236eb9833d2 +Subproject commit 03db505fda750fdecf8000d7ef7dd78dae65861c diff --git a/CMakeLists.txt b/CMakeLists.txt index 3fe03c9..ef64863 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,10 @@ if (POLICY CMP0074) cmake_policy(SET CMP0074 NEW) # CMake 3.12 endif () +if (POLICY CMP0077) + cmake_policy(SET CMP0077 NEW) +endif() + project(bergamot_translator CXX C) set(CMAKE_CXX_STANDARD 17) @@ -35,7 +39,7 @@ include(CMakeDependentOption) # Project specific cmake options option(COMPILE_WASM "Compile for WASM" OFF) -option(USE_WASM_COMPATIBLE_SOURCE "Use wasm compatible sources" ON) +cmake_dependent_option(USE_WASM_COMPATIBLE_SOURCE "Use wasm compatible sources" OFF "NOT COMPILE_WASM" ON) option(COMPILE_TESTS "Compile bergamot-tests" OFF) SET(PACKAGE_DIR "" CACHE STRING "Directory including all the files to be packaged (pre-loaded) in wasm builds")