From 36923c1e93c7e590a19aeb88b13a05f7cbd820d9 Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Sat, 24 Jul 2021 21:07:11 +0200 Subject: [PATCH] Enable -fexceptions in decoder builds --- native_client/BUILD | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/native_client/BUILD b/native_client/BUILD index d11935fa..d11a55bf 100644 --- a/native_client/BUILD +++ b/native_client/BUILD @@ -129,6 +129,7 @@ cc_library( includes = DECODER_INCLUDES, deps = [":kenlm"], linkopts = DECODER_LINKOPTS, + copts = ["-fexceptions"], ) cc_library( @@ -151,7 +152,7 @@ cc_library( "tfmodelstate.cc", ], }) + DECODER_SOURCES, - copts = tf_copts() + select({ + copts = tf_copts(allow_exceptions=True) + select({ # -fvisibility=hidden is not required on Windows, MSCV hides all declarations by default "//tensorflow:windows": ["/w"], # -Wno-sign-compare to silent a lot of warnings from tensorflow itself, @@ -163,7 +164,7 @@ cc_library( }) + select({ "//native_client:tflite": ["-DUSE_TFLITE"], "//conditions:default": ["-UUSE_TFLITE"], - }) + tflite_copts(), + }), linkopts = lrt_if_needed() + select({ "//tensorflow:macos": [], "//tensorflow:ios": ["-fembed-bitcode"], @@ -255,7 +256,10 @@ cc_binary( "generate_scorer_package.cpp", "stt_errors.cc", ], - copts = ["-std=c++11"], + copts = select({ + "//tensorflow:windows": [], + "//conditions:default": ["-std=c++11"], + }), deps = [ ":decoder", ":kenlm",