diff --git a/BUILD b/BUILD index b424416..ff73aea 100644 --- a/BUILD +++ b/BUILD @@ -5,18 +5,6 @@ load("@//bazel:pkg_info.bzl", "pkg_variables", "pkg_version") package(default_visibility = ["//visibility:public"]) -cc_binary( - name = "bazel-compile-commands", - srcs = ["main.cpp"], - deps = [ - "//bcc:bazel", - "//bcc:compile_commands", - "//bcc:options", - "//bcc:platform", - "//bcc:replacements", - ], -) - pandoc( name = "man", out = "bazel-compile-commands.1", @@ -28,7 +16,7 @@ pandoc( pkg_tar( name = "bin.tar", - srcs = [":bazel-compile-commands"], + srcs = ["//bcc:bazel-compile-commands"], mode = "0755", package_dir = "bin", ) diff --git a/bcc/BUILD b/bcc/BUILD index dfbc5f1..8149a5d 100644 --- a/bcc/BUILD +++ b/bcc/BUILD @@ -1,5 +1,17 @@ package(default_visibility = ["//visibility:public"]) +cc_binary( + name = "bazel-compile-commands", + srcs = ["main.cpp"], + deps = [ + ":bazel", + ":compile_commands", + ":options", + ":platform", + ":replacements", + ], +) + cc_proto_library( name = "analysis", deps = ["@io_bazel//src/main/protobuf:analysis_v2_proto"], diff --git a/main.cpp b/bcc/main.cpp similarity index 100% rename from main.cpp rename to bcc/main.cpp diff --git a/tests/BUILD b/tests/BUILD index ac8288d..e3751c5 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -4,7 +4,7 @@ cc_test( srcs = ["self_test.cpp"], data = [ ":bazel-mock", - "//:bazel-compile-commands", + "//bcc:bazel-compile-commands", ], deps = [ "@bazel_tools//tools/cpp/runfiles", diff --git a/tests/self_test.cpp b/tests/self_test.cpp index ac2aa9e..3dfd27a 100644 --- a/tests/self_test.cpp +++ b/tests/self_test.cpp @@ -56,7 +56,7 @@ TEST(self_test, run) std::unique_ptr runfiles(Runfiles::CreateForTest(&error)); ASSERT_THAT(runfiles, NotNull()) << error; - const auto bcc_path = runfiles->Rlocation("bazel-compile-commands/bazel-compile-commands"); + const auto bcc_path = runfiles->Rlocation("bazel-compile-commands/bcc/bazel-compile-commands"); ASSERT_THAT(bcc_path, Not(IsEmpty())) << bcc_path; ASSERT_THAT(boost::filesystem::exists(bcc_path), IsTrue()) << bcc_path;