Define _USE_MATH_DEFINES for windows builds.
PiperOrigin-RevId: 286642121 Change-Id: I8ec228fd768df5b20a11cdc63fcf219d6ab24de7
This commit is contained in:
parent
54041ccde5
commit
42f8dd1f35
4
.bazelrc
4
.bazelrc
@ -238,6 +238,10 @@ build:linux --copt=-w
|
|||||||
build:macos --copt=-w
|
build:macos --copt=-w
|
||||||
build:windows --copt=/w
|
build:windows --copt=/w
|
||||||
|
|
||||||
|
# Tensorflow uses M_* math constants that only get defined by MSVC headers if
|
||||||
|
# _USE_MATH_DEFINES is defined.
|
||||||
|
build:windows --copt=/D_USE_MATH_DEFINES
|
||||||
|
|
||||||
# Default paths for TF_SYSTEM_LIBS
|
# Default paths for TF_SYSTEM_LIBS
|
||||||
build:linux --define=PREFIX=/usr
|
build:linux --define=PREFIX=/usr
|
||||||
build:linux --define=LIBDIR=$(PREFIX)/lib
|
build:linux --define=LIBDIR=$(PREFIX)/lib
|
||||||
|
@ -13,7 +13,6 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include "tensorflow/cc/ops/array_ops_internal.h"
|
#include "tensorflow/cc/ops/array_ops_internal.h"
|
||||||
|
@ -15,9 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/compiler/xla/client/lib/math.h"
|
#include "tensorflow/compiler/xla/client/lib/math.h"
|
||||||
|
|
||||||
// This macro is required to make MSVC defines math constants in math.h
|
#include <cmath>
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
#include "tensorflow/compiler/xla/client/lib/arithmetic.h"
|
#include "tensorflow/compiler/xla/client/lib/arithmetic.h"
|
||||||
#include "tensorflow/compiler/xla/client/lib/constants.h"
|
#include "tensorflow/compiler/xla/client/lib/constants.h"
|
||||||
|
@ -18,10 +18,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <math.h>
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#undef _USE_MATH_DEFINES
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
@ -15,8 +15,8 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/lib/random/random_distributions.h"
|
#include "tensorflow/core/lib/random/random_distributions.h"
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cmath>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
@ -14,8 +14,6 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
#include "tensorflow/lite/experimental/microfrontend/lib/window_util.h"
|
#include "tensorflow/lite/experimental/microfrontend/lib/window_util.h"
|
||||||
|
|
||||||
// This macro is required to make MSVC defines math constants in math.h
|
|
||||||
#define _USE_MATH_DEFINES
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -267,6 +267,8 @@ def get_win_copts(is_external = False):
|
|||||||
# "/EHs-c-",
|
# "/EHs-c-",
|
||||||
"/wd4577",
|
"/wd4577",
|
||||||
"/DNOGDI",
|
"/DNOGDI",
|
||||||
|
# Also see build:windows lines in tensorflow/opensource_only/.bazelrc
|
||||||
|
# where we set some other options globally.
|
||||||
]
|
]
|
||||||
if is_external:
|
if is_external:
|
||||||
return WINDOWS_COPTS + ["/UTF_COMPILE_LIBRARY"]
|
return WINDOWS_COPTS + ["/UTF_COMPILE_LIBRARY"]
|
||||||
|
Loading…
Reference in New Issue
Block a user