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:
Gunhan Gulsoy 2020-01-12 11:43:00 -08:00 committed by TensorFlower Gardener
parent b69ad38b3b
commit e72495d380
6 changed files with 6 additions and 6 deletions

View File

@ -15,6 +15,7 @@
load(
"//tensorflow:tensorflow.bzl",
"check_deps",
"if_windows",
"tf_cc_binary",
"tf_cc_test",
"tf_copts",
@ -115,6 +116,7 @@ tf_cuda_library(
srcs = ["debug_io_utils.cc"],
hdrs = ["debug_io_utils.h"],
copts = tf_copts(),
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
linkstatic = 1,
deps = [
":debug_callback_registry",

View File

@ -27,8 +27,6 @@ limitations under the License.
#ifndef PLATFORM_WINDOWS
#include "grpcpp/create_channel.h"
#else
// winsock2.h is used in grpc, so Ws2_32.lib is needed
#pragma comment(lib, "Ws2_32.lib")
#endif // #ifndef PLATFORM_WINDOWS
#include "absl/strings/ascii.h"

View File

@ -1,6 +1,7 @@
# Tensorflow windows-specific implementations of tensorflow/core/platform libraries.
load(
"//tensorflow:tensorflow.bzl",
"if_windows",
"tf_copts",
)
@ -111,6 +112,7 @@ cc_library(
name = "net",
srcs = ["net.cc"],
hdrs = ["//tensorflow/core/platform:net.h"],
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
tags = [
"manual",
"no_oss",

View File

@ -26,8 +26,6 @@ limitations under the License.
#undef ERROR
#pragma comment(lib, "Ws2_32.lib")
namespace tensorflow {
namespace internal {

View File

@ -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")
package(
@ -30,6 +30,7 @@ cc_library(
],
),
hdrs = glob(["**/*.h"]),
linkopts = if_windows(["-DEFAULTLIB:ws2_32.lib"]),
deps = [
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",

View File

@ -19,7 +19,6 @@ limitations under the License.
#include <direct.h>
#include <stdlib.h>
#include <WinSock2.h>
#pragma comment(lib, "Ws2_32.lib")
#else
#include <errno.h>
#include <unistd.h>