Windows: Make TensorFlow build without --cpu=x64_windows_msvc (#10466)
* Windows: Make TensorFlow build without --cpu=x64_windows_msvc Since from Bazel 0.5.0, MSVC toolchain became the default toolchain on Windows. So --cpu=x64_windows_msvc is not required as long as we adjust the BUILD files in TensorFlow. --cpu=x64_windows_msvc is also supported for now, but is depracated. The configuration for cpu value x64_windows_msvc is a duplicate of x64_windows, which should be removed in the future. * Fix breakage on macOS
This commit is contained in:
parent
02dbe153af
commit
08ed32dbb9
@ -71,6 +71,12 @@ config_setting(
|
|||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows",
|
name = "windows",
|
||||||
|
values = {"cpu": "x64_windows"},
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows_msvc",
|
||||||
values = {"cpu": "x64_windows_msvc"},
|
values = {"cpu": "x64_windows_msvc"},
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
@ -458,6 +464,7 @@ cc_binary(
|
|||||||
"//tensorflow/c:exported_symbols.lds",
|
"//tensorflow/c:exported_symbols.lds",
|
||||||
],
|
],
|
||||||
"//tensorflow:windows": [],
|
"//tensorflow:windows": [],
|
||||||
|
"//tensorflow:windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-z defs",
|
"-z defs",
|
||||||
"-s",
|
"-s",
|
||||||
|
@ -413,6 +413,7 @@ tf_cuda_library(
|
|||||||
"util/work_sharder.h",
|
"util/work_sharder.h",
|
||||||
] + select({
|
] + select({
|
||||||
"//tensorflow:windows": [],
|
"//tensorflow:windows": [],
|
||||||
|
"//tensorflow:windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"util/memmapped_file_system.h",
|
"util/memmapped_file_system.h",
|
||||||
"util/memmapped_file_system_writer.h",
|
"util/memmapped_file_system_writer.h",
|
||||||
@ -1208,10 +1209,7 @@ tf_proto_library_cc(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
LIB_INTERNAL_WINDOWS_DEPS = glob(
|
||||||
name = "lib_internal",
|
|
||||||
srcs = select({
|
|
||||||
"//tensorflow:windows": glob(
|
|
||||||
[
|
[
|
||||||
"lib/**/*.h",
|
"lib/**/*.h",
|
||||||
"lib/**/*.cc",
|
"lib/**/*.cc",
|
||||||
@ -1233,7 +1231,13 @@ cc_library(
|
|||||||
"platform/**/stream_executor.h",
|
"platform/**/stream_executor.h",
|
||||||
"platform/load_library.cc",
|
"platform/load_library.cc",
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
|
|
||||||
|
cc_library(
|
||||||
|
name = "lib_internal",
|
||||||
|
srcs = select({
|
||||||
|
"//tensorflow:windows": LIB_INTERNAL_WINDOWS_DEPS,
|
||||||
|
"//tensorflow:windows_msvc": LIB_INTERNAL_WINDOWS_DEPS,
|
||||||
"//conditions:default": glob(
|
"//conditions:default": glob(
|
||||||
[
|
[
|
||||||
"lib/**/*.h",
|
"lib/**/*.h",
|
||||||
@ -1437,6 +1441,7 @@ tf_cuda_library(
|
|||||||
],
|
],
|
||||||
) + select({
|
) + select({
|
||||||
"//tensorflow:windows": [],
|
"//tensorflow:windows": [],
|
||||||
|
"//tensorflow:windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"util/memmapped_file_system.h",
|
"util/memmapped_file_system.h",
|
||||||
"util/memmapped_file_system.cc",
|
"util/memmapped_file_system.cc",
|
||||||
|
@ -98,12 +98,14 @@ def tf_proto_library(name, srcs = [], has_services = None,
|
|||||||
)
|
)
|
||||||
|
|
||||||
def tf_additional_lib_hdrs(exclude = []):
|
def tf_additional_lib_hdrs(exclude = []):
|
||||||
return select({
|
windows_hdrs = native.glob([
|
||||||
"//tensorflow:windows" : native.glob([
|
|
||||||
"platform/default/*.h",
|
"platform/default/*.h",
|
||||||
"platform/windows/*.h",
|
"platform/windows/*.h",
|
||||||
"platform/posix/error.h",
|
"platform/posix/error.h",
|
||||||
], exclude = exclude),
|
], exclude = exclude)
|
||||||
|
return select({
|
||||||
|
"//tensorflow:windows" : windows_hdrs,
|
||||||
|
"//tensorflow:windows_msvc" : windows_hdrs,
|
||||||
"//conditions:default" : native.glob([
|
"//conditions:default" : native.glob([
|
||||||
"platform/default/*.h",
|
"platform/default/*.h",
|
||||||
"platform/posix/*.h",
|
"platform/posix/*.h",
|
||||||
@ -111,12 +113,14 @@ def tf_additional_lib_hdrs(exclude = []):
|
|||||||
})
|
})
|
||||||
|
|
||||||
def tf_additional_lib_srcs(exclude = []):
|
def tf_additional_lib_srcs(exclude = []):
|
||||||
return select({
|
windows_srcs = native.glob([
|
||||||
"//tensorflow:windows" : native.glob([
|
|
||||||
"platform/default/*.cc",
|
"platform/default/*.cc",
|
||||||
"platform/windows/*.cc",
|
"platform/windows/*.cc",
|
||||||
"platform/posix/error.cc",
|
"platform/posix/error.cc",
|
||||||
], exclude = exclude),
|
], exclude = exclude)
|
||||||
|
return select({
|
||||||
|
"//tensorflow:windows" : windows_srcs,
|
||||||
|
"//tensorflow:windows_msvc" : windows_srcs,
|
||||||
"//conditions:default" : native.glob([
|
"//conditions:default" : native.glob([
|
||||||
"platform/default/*.cc",
|
"platform/default/*.cc",
|
||||||
"platform/posix/*.cc",
|
"platform/posix/*.cc",
|
||||||
@ -148,11 +152,13 @@ def tf_env_time_hdrs():
|
|||||||
]
|
]
|
||||||
|
|
||||||
def tf_env_time_srcs():
|
def tf_env_time_srcs():
|
||||||
return select({
|
win_env_time = native.glob([
|
||||||
"//tensorflow:windows" : native.glob([
|
|
||||||
"platform/windows/env_time.cc",
|
"platform/windows/env_time.cc",
|
||||||
"platform/env_time.cc",
|
"platform/env_time.cc",
|
||||||
], exclude = []),
|
], exclude = [])
|
||||||
|
return select({
|
||||||
|
"//tensorflow:windows" : win_env_time,
|
||||||
|
"//tensorflow:windows_msvc" : win_env_time,
|
||||||
"//conditions:default" : native.glob([
|
"//conditions:default" : native.glob([
|
||||||
"platform/posix/env_time.cc",
|
"platform/posix/env_time.cc",
|
||||||
"platform/env_time.cc",
|
"platform/env_time.cc",
|
||||||
|
@ -163,6 +163,7 @@ cc_binary(
|
|||||||
LINKER_EXPORTED_SYMBOLS,
|
LINKER_EXPORTED_SYMBOLS,
|
||||||
],
|
],
|
||||||
"//tensorflow:windows": [],
|
"//tensorflow:windows": [],
|
||||||
|
"//tensorflow:windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-z defs",
|
"-z defs",
|
||||||
"-s",
|
"-s",
|
||||||
|
@ -112,6 +112,7 @@ def if_not_mobile(a):
|
|||||||
def if_not_windows(a):
|
def if_not_windows(a):
|
||||||
return select({
|
return select({
|
||||||
clean_dep("//tensorflow:windows"): [],
|
clean_dep("//tensorflow:windows"): [],
|
||||||
|
clean_dep("//tensorflow:windows_msvc"): [],
|
||||||
"//conditions:default": a,
|
"//conditions:default": a,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -120,6 +121,7 @@ def if_x86(a):
|
|||||||
return select({
|
return select({
|
||||||
clean_dep("//tensorflow:linux_x86_64"): a,
|
clean_dep("//tensorflow:linux_x86_64"): a,
|
||||||
clean_dep("//tensorflow:windows"): a,
|
clean_dep("//tensorflow:windows"): a,
|
||||||
|
clean_dep("//tensorflow:windows_msvc"): a,
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -129,6 +131,15 @@ def if_darwin(a):
|
|||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
WIN_COPTS = [
|
||||||
|
"/DLANG_CXX11",
|
||||||
|
"/D__VERSION__=\\\"MSVC\\\"",
|
||||||
|
"/DPLATFORM_WINDOWS",
|
||||||
|
"/DTF_COMPILE_LIBRARY",
|
||||||
|
"/DEIGEN_HAS_C99_MATH",
|
||||||
|
"/DTENSORFLOW_USE_EIGEN_THREADPOOL",
|
||||||
|
]
|
||||||
|
|
||||||
# LINT.IfChange
|
# LINT.IfChange
|
||||||
def tf_copts():
|
def tf_copts():
|
||||||
return ([
|
return ([
|
||||||
@ -144,14 +155,8 @@ def tf_copts():
|
|||||||
"-O2",
|
"-O2",
|
||||||
],
|
],
|
||||||
clean_dep("//tensorflow:darwin"): [],
|
clean_dep("//tensorflow:darwin"): [],
|
||||||
clean_dep("//tensorflow:windows"): [
|
clean_dep("//tensorflow:windows"): WIN_COPTS,
|
||||||
"/DLANG_CXX11",
|
clean_dep("//tensorflow:windows_msvc"): WIN_COPTS,
|
||||||
"/D__VERSION__=\\\"MSVC\\\"",
|
|
||||||
"/DPLATFORM_WINDOWS",
|
|
||||||
"/DTF_COMPILE_LIBRARY",
|
|
||||||
"/DEIGEN_HAS_C99_MATH",
|
|
||||||
"/DTENSORFLOW_USE_EIGEN_THREADPOOL",
|
|
||||||
],
|
|
||||||
clean_dep("//tensorflow:ios"): ["-std=c++11"],
|
clean_dep("//tensorflow:ios"): ["-std=c++11"],
|
||||||
"//conditions:default": ["-pthread"]
|
"//conditions:default": ["-pthread"]
|
||||||
}))
|
}))
|
||||||
@ -996,6 +1001,7 @@ def tf_py_wrap_cc(name,
|
|||||||
clean_dep("//tensorflow:tf_exported_symbols.lds")
|
clean_dep("//tensorflow:tf_exported_symbols.lds")
|
||||||
],
|
],
|
||||||
clean_dep("//tensorflow:windows"): [],
|
clean_dep("//tensorflow:windows"): [],
|
||||||
|
clean_dep("//tensorflow:windows_msvc"): [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-Wl,--version-script",
|
"-Wl,--version-script",
|
||||||
clean_dep("//tensorflow:tf_version_script.lds")
|
clean_dep("//tensorflow:tf_version_script.lds")
|
||||||
@ -1006,6 +1012,7 @@ def tf_py_wrap_cc(name,
|
|||||||
clean_dep("//tensorflow:tf_exported_symbols.lds")
|
clean_dep("//tensorflow:tf_exported_symbols.lds")
|
||||||
],
|
],
|
||||||
clean_dep("//tensorflow:windows"): [],
|
clean_dep("//tensorflow:windows"): [],
|
||||||
|
clean_dep("//tensorflow:windows_msvc"): [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
clean_dep("//tensorflow:tf_version_script.lds")
|
clean_dep("//tensorflow:tf_version_script.lds")
|
||||||
]
|
]
|
||||||
|
@ -55,4 +55,4 @@ export PATH="/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/extras/CUPT
|
|||||||
export PATH="/c/tools/cuda/bin:$PATH"
|
export PATH="/c/tools/cuda/bin:$PATH"
|
||||||
|
|
||||||
# Set the common build options on Windows
|
# Set the common build options on Windows
|
||||||
export BUILD_OPTS='--cpu=x64_windows_msvc --host_cpu=x64_windows_msvc --copt=-w --host_copt=-w --verbose_failures --experimental_ui'
|
export BUILD_OPTS='--copt=-w --host_copt=-w --verbose_failures --experimental_ui'
|
||||||
|
@ -132,6 +132,7 @@ sh_binary(
|
|||||||
srcs = ["build_pip_package.sh"],
|
srcs = ["build_pip_package.sh"],
|
||||||
data = select({
|
data = select({
|
||||||
"//tensorflow:windows": [":simple_console_for_windows"],
|
"//tensorflow:windows": [":simple_console_for_windows"],
|
||||||
|
"//tensorflow:windows_msvc": [":simple_console_for_windows"],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
":licenses",
|
":licenses",
|
||||||
"MANIFEST.in",
|
"MANIFEST.in",
|
||||||
|
@ -44,6 +44,7 @@ cc_library(
|
|||||||
hdrs = ["gen_proto_text_functions_lib.h"],
|
hdrs = ["gen_proto_text_functions_lib.h"],
|
||||||
linkopts = select({
|
linkopts = select({
|
||||||
"//tensorflow:windows": [],
|
"//tensorflow:windows": [],
|
||||||
|
"//tensorflow:windows_msvc": [],
|
||||||
"//tensorflow:darwin": [
|
"//tensorflow:darwin": [
|
||||||
"-lm",
|
"-lm",
|
||||||
"-lpthread",
|
"-lpthread",
|
||||||
|
65
third_party/curl.BUILD
vendored
65
third_party/curl.BUILD
vendored
@ -5,6 +5,26 @@ licenses(["notice"]) # MIT/X derivative license
|
|||||||
|
|
||||||
exports_files(["COPYING"])
|
exports_files(["COPYING"])
|
||||||
|
|
||||||
|
CURL_WIN_COPTS = [
|
||||||
|
"/I%prefix%/curl/lib",
|
||||||
|
"/DHAVE_CONFIG_H",
|
||||||
|
"/DCURL_DISABLE_FTP",
|
||||||
|
"/DCURL_DISABLE_NTLM",
|
||||||
|
"/DHAVE_LIBZ",
|
||||||
|
"/DHAVE_ZLIB_H",
|
||||||
|
# Defining _USING_V110_SDK71_ is hackery to defeat curl's incorrect
|
||||||
|
# detection of what OS releases we can build on with VC 2012. This
|
||||||
|
# may not be needed (or may have to change) if the WINVER setting
|
||||||
|
# changes in //third_party/msvc/vc_12_0/CROSSTOOL.
|
||||||
|
"/D_USING_V110_SDK71_",
|
||||||
|
]
|
||||||
|
|
||||||
|
CURL_WIN_SRCS = [
|
||||||
|
"lib/asyn-thread.c",
|
||||||
|
"lib/inet_ntop.c",
|
||||||
|
"lib/system_win32.c",
|
||||||
|
]
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "curl",
|
name = "curl",
|
||||||
srcs = [
|
srcs = [
|
||||||
@ -210,11 +230,8 @@ cc_library(
|
|||||||
"@%ws%//tensorflow:ios": [
|
"@%ws%//tensorflow:ios": [
|
||||||
"lib/vtls/darwinssl.c",
|
"lib/vtls/darwinssl.c",
|
||||||
],
|
],
|
||||||
"@%ws%//tensorflow:windows": [
|
"@%ws%//tensorflow:windows": CURL_WIN_SRCS,
|
||||||
"lib/asyn-thread.c",
|
"@%ws%//tensorflow:windows_msvc": CURL_WIN_SRCS,
|
||||||
"lib/inet_ntop.c",
|
|
||||||
"lib/system_win32.c",
|
|
||||||
],
|
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"lib/vtls/openssl.c",
|
"lib/vtls/openssl.c",
|
||||||
],
|
],
|
||||||
@ -231,19 +248,8 @@ cc_library(
|
|||||||
"include/curl/typecheck-gcc.h",
|
"include/curl/typecheck-gcc.h",
|
||||||
],
|
],
|
||||||
copts = select({
|
copts = select({
|
||||||
"@%ws%//tensorflow:windows": [
|
"@%ws%//tensorflow:windows": CURL_WIN_COPTS,
|
||||||
"/I%prefix%/curl/lib",
|
"@%ws%//tensorflow:windows_msvc": CURL_WIN_COPTS,
|
||||||
"/DHAVE_CONFIG_H",
|
|
||||||
"/DCURL_DISABLE_FTP",
|
|
||||||
"/DCURL_DISABLE_NTLM",
|
|
||||||
"/DHAVE_LIBZ",
|
|
||||||
"/DHAVE_ZLIB_H",
|
|
||||||
# Defining _USING_V110_SDK71_ is hackery to defeat curl's incorrect
|
|
||||||
# detection of what OS releases we can build on with VC 2012. This
|
|
||||||
# may not be needed (or may have to change) if the WINVER setting
|
|
||||||
# changes in //third_party/msvc/vc_12_0/CROSSTOOL.
|
|
||||||
"/D_USING_V110_SDK71_",
|
|
||||||
],
|
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-I%prefix%/curl/lib",
|
"-I%prefix%/curl/lib",
|
||||||
"-D_GNU_SOURCE",
|
"-D_GNU_SOURCE",
|
||||||
@ -262,6 +268,10 @@ cc_library(
|
|||||||
# See curl.h for discussion of write size and Windows
|
# See curl.h for discussion of write size and Windows
|
||||||
"/DCURL_MAX_WRITE_SIZE=16384",
|
"/DCURL_MAX_WRITE_SIZE=16384",
|
||||||
],
|
],
|
||||||
|
"@%ws%//tensorflow:windows_msvc": [
|
||||||
|
# See curl.h for discussion of write size and Windows
|
||||||
|
"/DCURL_MAX_WRITE_SIZE=16384",
|
||||||
|
],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-DCURL_MAX_WRITE_SIZE=65536",
|
"-DCURL_MAX_WRITE_SIZE=65536",
|
||||||
],
|
],
|
||||||
@ -279,7 +289,10 @@ cc_library(
|
|||||||
],
|
],
|
||||||
"@%ws%//tensorflow:ios": [],
|
"@%ws%//tensorflow:ios": [],
|
||||||
"@%ws%//tensorflow:windows": [
|
"@%ws%//tensorflow:windows": [
|
||||||
"ws2_32.lib",
|
"-Wl,ws2_32.lib",
|
||||||
|
],
|
||||||
|
"@%ws%//tensorflow:windows_msvc": [
|
||||||
|
"-Wl,ws2_32.lib",
|
||||||
],
|
],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-lrt",
|
"-lrt",
|
||||||
@ -291,12 +304,19 @@ cc_library(
|
|||||||
] + select({
|
] + select({
|
||||||
"@%ws%//tensorflow:ios": [],
|
"@%ws%//tensorflow:ios": [],
|
||||||
"@%ws%//tensorflow:windows": [],
|
"@%ws%//tensorflow:windows": [],
|
||||||
|
"@%ws%//tensorflow:windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"@boringssl//:ssl",
|
"@boringssl//:ssl",
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
CURL_BIN_WIN_COPTS = [
|
||||||
|
"/I%prefix%/curl/lib",
|
||||||
|
"/DHAVE_CONFIG_H",
|
||||||
|
"/DCURL_DISABLE_LIBCURL_OPTION",
|
||||||
|
]
|
||||||
|
|
||||||
cc_binary(
|
cc_binary(
|
||||||
name = "curl_bin",
|
name = "curl_bin",
|
||||||
srcs = [
|
srcs = [
|
||||||
@ -386,11 +406,8 @@ cc_binary(
|
|||||||
"src/tool_xattr.h",
|
"src/tool_xattr.h",
|
||||||
],
|
],
|
||||||
copts = select({
|
copts = select({
|
||||||
"@%ws%//tensorflow:windows": [
|
"@%ws%//tensorflow:windows": CURL_BIN_WIN_COPTS,
|
||||||
"/I%prefix%/curl/lib",
|
"@%ws%//tensorflow:windows_msvc": CURL_BIN_WIN_COPTS,
|
||||||
"/DHAVE_CONFIG_H",
|
|
||||||
"/DCURL_DISABLE_LIBCURL_OPTION",
|
|
||||||
],
|
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-I%prefix%/curl/lib",
|
"-I%prefix%/curl/lib",
|
||||||
"-D_GNU_SOURCE",
|
"-D_GNU_SOURCE",
|
||||||
|
10
third_party/farmhash.BUILD
vendored
10
third_party/farmhash.BUILD
vendored
@ -3,12 +3,19 @@ licenses(["notice"]) # MIT
|
|||||||
exports_files(["COPYING"])
|
exports_files(["COPYING"])
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows",
|
name = "windows_msvc",
|
||||||
values = {
|
values = {
|
||||||
"cpu": "x64_windows_msvc",
|
"cpu": "x64_windows_msvc",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows",
|
||||||
|
values = {
|
||||||
|
"cpu": "x64_windows",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
name = "farmhash",
|
name = "farmhash",
|
||||||
srcs = ["src/farmhash.cc"],
|
srcs = ["src/farmhash.cc"],
|
||||||
@ -16,6 +23,7 @@ cc_library(
|
|||||||
# Disable __builtin_expect support on Windows
|
# Disable __builtin_expect support on Windows
|
||||||
copts = select({
|
copts = select({
|
||||||
":windows": ["/DFARMHASH_OPTIONAL_BUILTIN_EXPECT"],
|
":windows": ["/DFARMHASH_OPTIONAL_BUILTIN_EXPECT"],
|
||||||
|
":windows_msvc": ["/DFARMHASH_OPTIONAL_BUILTIN_EXPECT"],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
}),
|
}),
|
||||||
includes = ["src/."],
|
includes = ["src/."],
|
||||||
|
14
third_party/gif.BUILD
vendored
14
third_party/gif.BUILD
vendored
@ -24,6 +24,7 @@ cc_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = select({
|
deps = select({
|
||||||
":windows": [":windows_polyfill"],
|
":windows": [":windows_polyfill"],
|
||||||
|
":windows_msvc": [":windows_polyfill"],
|
||||||
"//conditions:default": [],
|
"//conditions:default": [],
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@ -41,6 +42,15 @@ genrule(
|
|||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows",
|
name = "windows_msvc",
|
||||||
values = {"cpu": "x64_windows_msvc"},
|
values = {
|
||||||
|
"cpu": "x64_windows_msvc",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows",
|
||||||
|
values = {
|
||||||
|
"cpu": "x64_windows",
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
20
third_party/jpeg/jpeg.BUILD
vendored
20
third_party/jpeg/jpeg.BUILD
vendored
@ -9,17 +9,20 @@ load("@%ws%//third_party:common.bzl", "template_rule")
|
|||||||
|
|
||||||
libjpegturbo_nocopts = "-[W]error"
|
libjpegturbo_nocopts = "-[W]error"
|
||||||
|
|
||||||
|
WIN_COPTS = [
|
||||||
|
"/Ox",
|
||||||
|
"/w14711", # function 'function' selected for inline expansion
|
||||||
|
"/w14710", # 'function' : function not inlined
|
||||||
|
]
|
||||||
|
|
||||||
libjpegturbo_copts = select({
|
libjpegturbo_copts = select({
|
||||||
":android": [
|
":android": [
|
||||||
"-O2",
|
"-O2",
|
||||||
"-fPIE",
|
"-fPIE",
|
||||||
"-w",
|
"-w",
|
||||||
],
|
],
|
||||||
":windows": [
|
":windows": WIN_COPTS,
|
||||||
"/Ox",
|
":windows_msvc": WIN_COPTS,
|
||||||
"/w14711", # function 'function' selected for inline expansion
|
|
||||||
"/w14710", # 'function' : function not inlined
|
|
||||||
],
|
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-O3",
|
"-O3",
|
||||||
"-w",
|
"-w",
|
||||||
@ -370,6 +373,7 @@ genrule(
|
|||||||
outs = ["jconfig.h"],
|
outs = ["jconfig.h"],
|
||||||
cmd = select({
|
cmd = select({
|
||||||
":windows": "cp $(location jconfig_win.h) $@",
|
":windows": "cp $(location jconfig_win.h) $@",
|
||||||
|
":windows_msvc": "cp $(location jconfig_win.h) $@",
|
||||||
":k8": "cp $(location jconfig_nowin_simd.h) $@",
|
":k8": "cp $(location jconfig_nowin_simd.h) $@",
|
||||||
":armeabi-v7a": "cp $(location jconfig_nowin_simd.h) $@",
|
":armeabi-v7a": "cp $(location jconfig_nowin_simd.h) $@",
|
||||||
":arm64-v8a": "cp $(location jconfig_nowin_simd.h) $@",
|
":arm64-v8a": "cp $(location jconfig_nowin_simd.h) $@",
|
||||||
@ -386,6 +390,7 @@ genrule(
|
|||||||
outs = ["jconfigint.h"],
|
outs = ["jconfigint.h"],
|
||||||
cmd = select({
|
cmd = select({
|
||||||
":windows": "cp $(location jconfigint_win.h) $@",
|
":windows": "cp $(location jconfigint_win.h) $@",
|
||||||
|
":windows_msvc": "cp $(location jconfigint_win.h) $@",
|
||||||
"//conditions:default": "cp $(location jconfigint_nowin.h) $@",
|
"//conditions:default": "cp $(location jconfigint_nowin.h) $@",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
@ -482,5 +487,10 @@ config_setting(
|
|||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows",
|
name = "windows",
|
||||||
|
values = {"cpu": "x64_windows"},
|
||||||
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows_msvc",
|
||||||
values = {"cpu": "x64_windows_msvc"},
|
values = {"cpu": "x64_windows_msvc"},
|
||||||
)
|
)
|
||||||
|
15
third_party/nasm.BUILD
vendored
15
third_party/nasm.BUILD
vendored
@ -101,6 +101,7 @@ cc_binary(
|
|||||||
],
|
],
|
||||||
copts = select({
|
copts = select({
|
||||||
":windows": [],
|
":windows": [],
|
||||||
|
":windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-w",
|
"-w",
|
||||||
"-std=c99",
|
"-std=c99",
|
||||||
@ -108,12 +109,22 @@ cc_binary(
|
|||||||
}),
|
}),
|
||||||
defines = select({
|
defines = select({
|
||||||
":windows": [],
|
":windows": [],
|
||||||
|
":windows_msvc": [],
|
||||||
"//conditions:default": ["HAVE_SNPRINTF"],
|
"//conditions:default": ["HAVE_SNPRINTF"],
|
||||||
}),
|
}),
|
||||||
visibility = ["@jpeg//:__pkg__"],
|
visibility = ["@jpeg//:__pkg__"],
|
||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "windows",
|
name = "windows_msvc",
|
||||||
values = {"cpu": "x64_windows_msvc"},
|
values = {
|
||||||
|
"cpu": "x64_windows_msvc",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows",
|
||||||
|
values = {
|
||||||
|
"cpu": "x64_windows",
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
1
third_party/snappy.BUILD
vendored
1
third_party/snappy.BUILD
vendored
@ -35,6 +35,7 @@ genrule(
|
|||||||
"-e 's/@ac_cv_have_stdint_h@/1/g' " +
|
"-e 's/@ac_cv_have_stdint_h@/1/g' " +
|
||||||
select({
|
select({
|
||||||
"@%ws%//tensorflow:windows": "-e 's/@ac_cv_have_sys_uio_h@/0/g' ",
|
"@%ws%//tensorflow:windows": "-e 's/@ac_cv_have_sys_uio_h@/0/g' ",
|
||||||
|
"@%ws%//tensorflow:windows_msvc": "-e 's/@ac_cv_have_sys_uio_h@/0/g' ",
|
||||||
"//conditions:default": "-e 's/@ac_cv_have_sys_uio_h@/1/g' ",
|
"//conditions:default": "-e 's/@ac_cv_have_sys_uio_h@/1/g' ",
|
||||||
}) +
|
}) +
|
||||||
"-e 's/@SNAPPY_MAJOR@/1/g' " +
|
"-e 's/@SNAPPY_MAJOR@/1/g' " +
|
||||||
|
10
third_party/swig.BUILD
vendored
10
third_party/swig.BUILD
vendored
@ -70,7 +70,8 @@ cc_binary(
|
|||||||
"Source/Swig/wrapfunc.c",
|
"Source/Swig/wrapfunc.c",
|
||||||
],
|
],
|
||||||
copts = ["$(STACK_FRAME_UNLIMITED)"] + select({
|
copts = ["$(STACK_FRAME_UNLIMITED)"] + select({
|
||||||
":x64_windows_msvc": [],
|
":windows": [],
|
||||||
|
":windows_msvc": [],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"-Wno-parentheses",
|
"-Wno-parentheses",
|
||||||
"-Wno-unused-variable",
|
"-Wno-unused-variable",
|
||||||
@ -331,6 +332,11 @@ genrule(
|
|||||||
)
|
)
|
||||||
|
|
||||||
config_setting(
|
config_setting(
|
||||||
name = "x64_windows_msvc",
|
name = "windows_msvc",
|
||||||
values = {"cpu": "x64_windows_msvc"},
|
values = {"cpu": "x64_windows_msvc"},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
config_setting(
|
||||||
|
name = "windows",
|
||||||
|
values = {"cpu": "x64_windows"},
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user