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(
|
||||
"//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",
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
|
@ -26,8 +26,6 @@ limitations under the License.
|
||||
|
||||
#undef ERROR
|
||||
|
||||
#pragma comment(lib, "Ws2_32.lib")
|
||||
|
||||
namespace tensorflow {
|
||||
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")
|
||||
|
||||
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",
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user