diff options
-rw-r--r-- | tensorflow/BUILD | 54 | ||||
-rw-r--r-- | tensorflow/cc/BUILD | 28 | ||||
-rw-r--r-- | tensorflow/core/BUILD | 19 | ||||
-rw-r--r-- | third_party/eigen3/BUILD | 10 |
4 files changed, 85 insertions, 26 deletions
diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 386e0096ff..c8e24e3aff 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -608,6 +608,47 @@ exports_files( ], ) +genrule( + name = "install_headers", + srcs = [ + "//tensorflow/c:headers", + "//tensorflow/c/eager:headers", + "//tensorflow/cc:headers", + "//tensorflow/core:headers", + ], + outs = ["include"], + cmd = """ + mkdir $@ + for f in $(SRCS); do + d="$${f%/*}" + d="$${d#bazel-out*genfiles/}" + d="$${d#*external/eigen_archive/}" + + if [[ $${d} == *local_config_* ]]; then + continue + fi + + mkdir -p "$@/$${d}" + cp "$${f}" "$@/$${d}/" + done + """, + tags = ["manual"], + visibility = ["//visibility:public"], +) + +genrule( + name = "root_init_gen", + srcs = select({ + "api_version_2": [":tf_python_api_gen_v2"], + "//conditions:default": [":tf_python_api_gen_v1"], + }), + outs = ["__init__.py"], + cmd = select({ + "api_version_2": "cp $(@D)/_api/v2/__init__.py $(OUTS)", + "//conditions:default": "cp $(@D)/_api/v1/__init__.py $(OUTS)", + }), +) + gen_api_init_files( name = "tf_python_api_gen_v1", srcs = ["api_template.__init__.py"], @@ -629,19 +670,6 @@ gen_api_init_files( root_init_template = "api_template.__init__.py", ) -genrule( - name = "root_init_gen", - srcs = select({ - "api_version_2": [":tf_python_api_gen_v2"], - "//conditions:default": [":tf_python_api_gen_v1"], - }), - outs = ["__init__.py"], - cmd = select({ - "api_version_2": "cp $(@D)/_api/v2/__init__.py $(OUTS)", - "//conditions:default": "cp $(@D)/_api/v1/__init__.py $(OUTS)", - }), -) - py_library( name = "tensorflow_py", srcs = ["//tensorflow/python/estimator/api:estimator_python_api_gen"], diff --git a/tensorflow/cc/BUILD b/tensorflow/cc/BUILD index f56521dac0..b587e63227 100644 --- a/tensorflow/cc/BUILD +++ b/tensorflow/cc/BUILD @@ -10,11 +10,12 @@ licenses(["notice"]) # Apache 2.0 load( "//tensorflow:tensorflow.bzl", - "tf_cc_test", + "cc_library_with_android_deps", "tf_cc_binary", + "tf_cc_test", "tf_copts", "tf_gen_op_wrappers_cc", - "cc_library_with_android_deps", + "transitive_hdrs", ) cc_library( @@ -716,3 +717,26 @@ tf_cc_test( "//tensorflow/core:testlib", ], ) + +transitive_hdrs( + name = "headers", + visibility = ["//tensorflow:__subpackages__"], + deps = [ + ":cc_ops", + ":client_session", + ":coordinator", + ":gradient_checker", + ":gradients", + ":ops", + ":queue_runner", + ":remote_fused_graph_ops", + ":scope", + "//tensorflow/cc/profiler", + "//tensorflow/cc/saved_model:constants", + "//tensorflow/cc/saved_model:loader", + "//tensorflow/cc/saved_model:reader", + "//tensorflow/cc/saved_model:signature_constants", + "//tensorflow/cc/saved_model:tag_constants", + "//tensorflow/cc/tools:freeze_saved_model", + ], +) diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD index 4074232c93..d55bd8d7ed 100644 --- a/tensorflow/core/BUILD +++ b/tensorflow/core/BUILD @@ -85,11 +85,12 @@ load( "tf_cc_tests", "tf_copts", "tf_cuda_library", + "tf_features_nomodules_if_android", "tf_gen_op_libs", "tf_generate_proto_text_sources", "tf_genrule_cmd_append_to_srcs", "tf_opts_nortti_if_android", - "tf_features_nomodules_if_android", + "transitive_hdrs", ) load("//tensorflow:tensorflow.bzl", "tf_cc_test_mkl") load("//tensorflow:tensorflow.bzl", "tf_cc_test_gpu") @@ -120,16 +121,16 @@ load( "tf_additional_libdevice_srcs", "tf_additional_minimal_lib_srcs", "tf_additional_mpi_lib_defines", - "tf_additional_proto_hdrs", "tf_additional_proto_compiler_hdrs", + "tf_additional_proto_hdrs", "tf_additional_proto_srcs", "tf_additional_test_deps", "tf_additional_test_srcs", "tf_additional_verbs_lib_defines", "tf_jspb_proto_library", "tf_kernel_tests_linkstatic", - "tf_lib_proto_parsing_deps", "tf_lib_proto_compiler_deps", + "tf_lib_proto_parsing_deps", "tf_nano_proto_library", "tf_platform_hdrs", "tf_platform_srcs", @@ -4720,6 +4721,18 @@ cc_library( ] + tf_additional_libdevice_deps(), ) +transitive_hdrs( + name = "headers", + visibility = ["//tensorflow:__subpackages__"], + deps = [ + "//tensorflow/core:core_cpu", + "//tensorflow/core:framework", + "//tensorflow/core:lib", + "//tensorflow/core:protos_all_cc", + "//tensorflow/core:stream_executor", + ], +) + # ----------------------------------------------------------------------------- # Google-internal targets go here (must be at the end). diff --git a/third_party/eigen3/BUILD b/third_party/eigen3/BUILD index 203991b50f..f072f2545a 100644 --- a/third_party/eigen3/BUILD +++ b/third_party/eigen3/BUILD @@ -66,19 +66,13 @@ genrule( outs = ["include"], cmd = """ mkdir $@ - for f in $(locations @eigen_archive//:eigen_header_files) ; do + for f in $(SRCS); do d="$${f%/*}" d="$${d#*external/eigen_archive/}" mkdir -p "$@/$${d}" cp "$${f}" "$@/$${d}/" done - - for f in $(locations :eigen_third_party_header_files) ; do - d="$${f%/*}" - - mkdir -p "$@/$${d}" - cp "$${f}" "$@/$${d}/" - done """, + tags = ["manual"], ) |