aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gunhan Gulsoy <gunan@google.com>2016-12-23 13:53:42 -0800
committerGravatar Gunhan Gulsoy <gunan@google.com>2016-12-23 13:53:42 -0800
commit0ff314b3ec34d6ceb2f01d2ae7439457291001fd (patch)
tree34699564b30afb25873a2136ffff9080c8ef7963
parent1e9ed820139f489e17fee294d72a42522e6297bf (diff)
Fix: Address style issues and review comments in third_party BUILD files.
-rw-r--r--third_party/common.bzl6
-rw-r--r--third_party/jpeg/jpeg.BUILD34
-rw-r--r--third_party/llvm/llvm.BUILD14
3 files changed, 29 insertions, 25 deletions
diff --git a/third_party/common.bzl b/third_party/common.bzl
index 18e3798c5a..90bd5e9642 100644
--- a/third_party/common.bzl
+++ b/third_party/common.bzl
@@ -6,7 +6,7 @@
# load("/tools/build_rules/expand_header_template", "expand_header_template")
# expand_header_template(
# name = "ExpandMyTemplate",
-# template = "my.template",
+# src = "my.template",
# out = "my.txt",
# substitutions = {
# "$VAR1": "foo",
@@ -22,7 +22,7 @@
def expand_header_template_impl(ctx):
ctx.template_action(
- template = ctx.file.template,
+ template = ctx.file.src,
output = ctx.outputs.out,
substitutions = ctx.attr.substitutions,
)
@@ -30,7 +30,7 @@ def expand_header_template_impl(ctx):
expand_header_template = rule(
implementation = expand_header_template_impl,
attrs = {
- "template": attr.label(mandatory=True, allow_files=True, single_file=True),
+ "src": attr.label(mandatory=True, allow_files=True, single_file=True),
"substitutions": attr.string_dict(mandatory=True),
"out": attr.output(mandatory=True),
},
diff --git a/third_party/jpeg/jpeg.BUILD b/third_party/jpeg/jpeg.BUILD
index 70f2be85b6..e005a1853d 100644
--- a/third_party/jpeg/jpeg.BUILD
+++ b/third_party/jpeg/jpeg.BUILD
@@ -286,7 +286,7 @@ expand_header_template(
"cmakedefine" : "define",
"@BITS_IN_JSAMPLE@" : "8",
},
- template = "win/jconfig.h.in",
+ src = "win/jconfig.h.in",
)
expand_header_template(
@@ -297,7 +297,7 @@ expand_header_template(
"@BUILD@" : "20161115",
"@CMAKE_PROJECT_NAME@" : "libjpeg-turbo",
},
- template = "win/jconfigint.h.in",
+ src = "win/jconfigint.h.in",
)
jconfig_nowin_common_substitutions = {
@@ -332,14 +332,14 @@ expand_header_template(
name = "jconfig_nowin_nosimd",
out = "jconfig_nowin_nosimd.h",
substitutions = jconfig_nowin_nosimd_substitutions,
- template = "jconfig.h.in",
+ src = "jconfig.h.in",
)
expand_header_template(
name = "jconfig_nowin_simd",
out = "jconfig_nowin_simd.h",
substitutions = jconfig_nowin_simd_substitutions,
- template = "jconfig.h.in",
+ src = "jconfig.h.in",
)
expand_header_template(
@@ -357,23 +357,23 @@ expand_header_template(
"#define SIZEOF_SIZE_T 4\n" +
"#endif\n",
},
- template = "jconfigint.h.in",
+ src = "jconfigint.h.in",
)
genrule(
name = "configure",
outs = ["jconfig.h"],
srcs = [
- ":jconfig_win",
- ":jconfig_nowin_nosimd",
- ":jconfig_nowin_simd",
+ "jconfig_win.h",
+ "jconfig_nowin_nosimd.h",
+ "jconfig_nowin_simd.h",
],
cmd = select({
- ":windows": "cp $(locations :jconfig_win) $(@D)/jconfig.h",
- ":k8": "cp $(locations :jconfig_nowin_simd) $(@D)/jconfig.h",
- ":armeabi-v7a": "cp $(locations :jconfig_nowin_simd) $(@D)/jconfig.h",
- ":arm64-v8a": "cp $(locations :jconfig_nowin_simd) $(@D)/jconfig.h",
- "//conditions:default": "cp $(locations :jconfig_nowin_nosimd) $(@D)/jconfig.h",
+ ":windows": "cp $(location jconfig_win.h) $@",
+ ":k8": "cp $(location jconfig_nowin_simd.h) $@",
+ ":armeabi-v7a": "cp $(location jconfig_nowin_simd.h) $@",
+ ":arm64-v8a": "cp $(location jconfig_nowin_simd.h) $@",
+ "//conditions:default": "cp $(location jconfig_nowin_nosimd.h) $@",
}),
)
@@ -381,12 +381,12 @@ genrule(
name = "configure_internal",
outs = ["jconfigint.h"],
srcs = [
- ":jconfigint_win",
- ":jconfigint_nowin",
+ "jconfigint_win.h",
+ "jconfigint_nowin.h",
],
cmd = select({
- ":windows": "cp $(locations :jconfigint_win) $(@D)/jconfigint.h",
- "//conditions:default": "cp $(locations :jconfigint_nowin) $(@D)/jconfigint.h",
+ ":windows": "cp $(location jconfigint_win.h) $@",
+ "//conditions:default": "cp $(location jconfigint_nowin.h) $@",
}),
)
diff --git a/third_party/llvm/llvm.BUILD b/third_party/llvm/llvm.BUILD
index 711ae38c3a..d4772a4cfc 100644
--- a/third_party/llvm/llvm.BUILD
+++ b/third_party/llvm/llvm.BUILD
@@ -10,11 +10,15 @@ load(
"@//third_party/llvm:llvm.bzl",
"gentbl",
"expand_cmake_vars",
- "expand_header_template",
"llvm_target_cmake_vars",
"cmake_var_string",
)
+load(
+ "@//third_party:common.bzl",
+ "expand_header_template",
+)
+
package(default_visibility = ["@//tensorflow/compiler/xla:internal"])
llvm_host_triple = "x86_64-unknown-linux_gnu"
@@ -184,7 +188,7 @@ expand_header_template(
["LLVM_TARGET({})".format(t) for t in llvm_targets],
),
},
- template = "include/llvm/Config/Targets.def.in",
+ src = "include/llvm/Config/Targets.def.in",
)
expand_header_template(
@@ -195,7 +199,7 @@ expand_header_template(
["LLVM_ASM_PARSER({})".format(t) for t in llvm_target_asm_parsers],
),
},
- template = "include/llvm/Config/AsmParsers.def.in",
+ src = "include/llvm/Config/AsmParsers.def.in",
)
expand_header_template(
@@ -206,7 +210,7 @@ expand_header_template(
["LLVM_ASM_PRINTER({})".format(t) for t in llvm_target_asm_printers],
),
},
- template = "include/llvm/Config/AsmPrinters.def.in",
+ src = "include/llvm/Config/AsmPrinters.def.in",
)
expand_header_template(
@@ -217,7 +221,7 @@ expand_header_template(
["LLVM_DISASSEMBLER({})".format(t) for t in llvm_target_disassemblers],
),
},
- template = "include/llvm/Config/Disassemblers.def.in",
+ src = "include/llvm/Config/Disassemblers.def.in",
)
# A common library that all LLVM targets depend on.