Move all linking information to BUILD files.
do not use windows specific "pragma comment". Just be consistent. PiperOrigin-RevId: 289338931 Change-Id: Ib5a3d479a7fd0863eeff6bb60933aeb83c26dc01
This commit is contained in:
parent
b69ad38b3b
commit
e72495d380
@ -15,6 +15,7 @@
|
|||||||
load(
|
load(
|
||||||
"//tensorflow:tensorflow.bzl",
|
"//tensorflow:tensorflow.bzl",
|
||||||
"check_deps",
|
"check_deps",
|
||||||
|
"if_windows",
|
||||||
"tf_cc_binary",
|
"tf_cc_binary",
|
||||||
"tf_cc_test",
|
"tf_cc_test",
|
||||||
"tf_copts",
|
"tf_copts",
|
||||||
@ -115,6 +116,7 @@ tf_cuda_library(
|
|||||||
srcs = ["debug_io_utils.cc"],
|
srcs = ["debug_io_utils.cc"],
|
||||||
hdrs = ["debug_io_utils.h"],
|
hdrs = ["debug_io_utils.h"],
|
||||||
copts = tf_copts(),
|
copts = tf_copts(),
|
||||||
|
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
|
||||||
linkstatic = 1,
|
linkstatic = 1,
|
||||||
deps = [
|
deps = [
|
||||||
":debug_callback_registry",
|
":debug_callback_registry",
|
||||||
|
@ -27,8 +27,6 @@ limitations under the License.
|
|||||||
#ifndef PLATFORM_WINDOWS
|
#ifndef PLATFORM_WINDOWS
|
||||||
#include "grpcpp/create_channel.h"
|
#include "grpcpp/create_channel.h"
|
||||||
#else
|
#else
|
||||||
// winsock2.h is used in grpc, so Ws2_32.lib is needed
|
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
|
||||||
#endif // #ifndef PLATFORM_WINDOWS
|
#endif // #ifndef PLATFORM_WINDOWS
|
||||||
|
|
||||||
#include "absl/strings/ascii.h"
|
#include "absl/strings/ascii.h"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Tensorflow windows-specific implementations of tensorflow/core/platform libraries.
|
# Tensorflow windows-specific implementations of tensorflow/core/platform libraries.
|
||||||
load(
|
load(
|
||||||
"//tensorflow:tensorflow.bzl",
|
"//tensorflow:tensorflow.bzl",
|
||||||
|
"if_windows",
|
||||||
"tf_copts",
|
"tf_copts",
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -111,6 +112,7 @@ cc_library(
|
|||||||
name = "net",
|
name = "net",
|
||||||
srcs = ["net.cc"],
|
srcs = ["net.cc"],
|
||||||
hdrs = ["//tensorflow/core/platform:net.h"],
|
hdrs = ["//tensorflow/core/platform:net.h"],
|
||||||
|
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
|
||||||
tags = [
|
tags = [
|
||||||
"manual",
|
"manual",
|
||||||
"no_oss",
|
"no_oss",
|
||||||
|
@ -26,8 +26,6 @@ limitations under the License.
|
|||||||
|
|
||||||
#undef ERROR
|
#undef ERROR
|
||||||
|
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
|
load("//tensorflow:tensorflow.bzl", "if_windows", "tf_cc_test")
|
||||||
load("//tensorflow/stream_executor:build_defs.bzl", "stream_executor_friends")
|
load("//tensorflow/stream_executor:build_defs.bzl", "stream_executor_friends")
|
||||||
|
|
||||||
package(
|
package(
|
||||||
@ -30,6 +30,7 @@ cc_library(
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
hdrs = glob(["**/*.h"]),
|
hdrs = glob(["**/*.h"]),
|
||||||
|
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
|
||||||
deps = [
|
deps = [
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
"//tensorflow/core:protos_all_cc",
|
"//tensorflow/core:protos_all_cc",
|
||||||
|
@ -19,7 +19,6 @@ limitations under the License.
|
|||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <WinSock2.h>
|
#include <WinSock2.h>
|
||||||
#pragma comment(lib, "Ws2_32.lib")
|
|
||||||
#else
|
#else
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user