Skip to content

Commit ca624db

Browse files
ssjhvSung Jin Hwang
authored andcommitted
Use .so or .dylib extension depending on the host os.
PiperOrigin-RevId: 258453048 Change-Id: Ie1f64eb1bfaa3e3f7cff53313a57edd75d9edd29
1 parent 8173a90 commit ca624db

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

workspace.bzl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ def _tensorflow_pip_impl(ctx):
2121
fail("Failed to find include path. Did you remember to pip install " +
2222
"tensorflow?: %s" % include_path.stderr)
2323

24-
library_filename = "libtensorflow_framework.so.1"
24+
if "linux" in ctx.os.name:
25+
library_filename = "libtensorflow_framework.so.1"
26+
elif "mac" in ctx.os.name:
27+
library_filename = "libtensorflow_framework.dylib"
28+
2529
ctx.symlink("/".join([library_path.stdout.strip(), library_filename]),
2630
library_filename)
2731
ctx.symlink(include_path.stdout.strip(), "include")
2832
ctx.file("BUILD", """
2933
cc_library(
3034
name = "libtensorflow_framework",
3135
srcs = ["{0}"],
32-
hdrs = glob(["include/**/*.h"]),
36+
hdrs = glob(["include/**"]),
3337
includes = ["include"],
3438
visibility = ["//visibility:public"],
3539
)

0 commit comments

Comments
 (0)