From 3db3f1f83a562587cc207106258751d089c48ae4 Mon Sep 17 00:00:00 2001 From: Loo Rong Jie Date: Wed, 4 Jul 2018 13:18:02 +0800 Subject: [MSVC] Disable C++ exceptions --- tensorflow/tensorflow.bzl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tensorflow/tensorflow.bzl') diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index e4632c4811..c3bd854940 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -180,9 +180,12 @@ def get_win_copts(is_external=False): "/DEIGEN_AVOID_STL_ARRAY", "/Iexternal/gemmlowp", "/wd4018", # -Wno-sign-compare - "/U_HAS_EXCEPTIONS", - "/D_HAS_EXCEPTIONS=1", - "/EHsc", # -fno-exceptions + # Bazel's CROSSTOOL currently pass /EHsc to enable exception by + # default. We can't pass /EHs-c- to disable exception, otherwise + # we will get a waterfall of flag conflict warnings. Wait for + # Bazel to fix this. + # "/D_HAS_EXCEPTIONS=0", + # "/EHs-c-", "/DNOGDI", ] if is_external: -- cgit v1.2.3 From 86ad3363e18f7df3f86f30150f7b13d389c459e5 Mon Sep 17 00:00:00 2001 From: Loo Rong Jie Date: Wed, 4 Jul 2018 19:32:20 +0800 Subject: Suppress /wd4577 'noexcept with no exception handling mode' warning --- tensorflow/contrib/cmake/CMakeLists.txt | 2 ++ tensorflow/tensorflow.bzl | 1 + 2 files changed, 3 insertions(+) (limited to 'tensorflow/tensorflow.bzl') diff --git a/tensorflow/contrib/cmake/CMakeLists.txt b/tensorflow/contrib/cmake/CMakeLists.txt index 693393c1e7..708618dcb0 100644 --- a/tensorflow/contrib/cmake/CMakeLists.txt +++ b/tensorflow/contrib/cmake/CMakeLists.txt @@ -177,6 +177,8 @@ if(WIN32) string(REPLACE "/EHsc" "/EHs-c-" ${flag} "${${flag}}") endforeach() add_definitions(/D_HAS_EXCEPTIONS=0) + # Suppress 'noexcept used with no exception handling mode specified' warning + add_compile_options(/wd4577) # Try to avoid flaky failures due to failed generation of generate.stamp files. set(CMAKE_SUPPRESS_REGENERATION ON) diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index c3bd854940..46d554a19d 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -186,6 +186,7 @@ def get_win_copts(is_external=False): # Bazel to fix this. # "/D_HAS_EXCEPTIONS=0", # "/EHs-c-", + "/wd4577", "/DNOGDI", ] if is_external: -- cgit v1.2.3