diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/cpp/BUILD | 39 | ||||
-rw-r--r-- | src/main/cpp/util/BUILD | 45 | ||||
-rw-r--r-- | src/main/native/BUILD | 3 |
3 files changed, 51 insertions, 36 deletions
diff --git a/src/main/cpp/BUILD b/src/main/cpp/BUILD index f2f4579679..c1f472b4fd 100644 --- a/src/main/cpp/BUILD +++ b/src/main/cpp/BUILD @@ -1,33 +1,5 @@ -cc_library( - name = "util", - srcs = [ - "util/errors.cc", - "util/file.cc", - "util/numbers.cc", - "util/port.cc", - "util/strings.cc", - ], - hdrs = [ - "util/errors.h", - "util/exit_code.h", - "util/file.h", - "util/numbers.h", - "util/port.h", - "util/strings.h", - ], - copts = [ - "-DBLAZE_OPENSOURCE=1", - ], - includes = ["."], -) - -cc_library( - name = "md5", - srcs = ["util/md5.cc"], - hdrs = ["util/md5.h"], - includes = ["."], - visibility = ["//visibility:public"], -) +# Description: +# The Bazel launcher. filegroup( name = "blaze_util_os", @@ -50,9 +22,7 @@ cc_binary( copts = [ "-Wno-sign-compare", "-DBLAZE_JAVA_CPU=\\\"k8\\\"", - "-DBLAZE_OPENSOURCE=1", ], - includes = ["."], linkopts = select({ "//src:darwin": [ ], @@ -62,8 +32,9 @@ cc_binary( }), visibility = ["//src:__pkg__"], deps = [ - ":md5", - ":util", + "//src/main/cpp/util", + "//src/main/cpp/util:md5", + "//src/main/cpp/util:strings", "//third_party/ijar:zip", ], ) diff --git a/src/main/cpp/util/BUILD b/src/main/cpp/util/BUILD new file mode 100644 index 0000000000..ef3b2f952f --- /dev/null +++ b/src/main/cpp/util/BUILD @@ -0,0 +1,45 @@ +# Description: +# C++ utility source for Bazel + +cc_library( + name = "util", + srcs = [ + "errors.cc", + "file.cc", + "numbers.cc", + "port.cc", + ], + hdrs = [ + "errors.h", + "file.h", + "numbers.h", + "port.h", + ], + visibility = ["//visibility:public"], + deps = [ + ":strings", + ], +) + +cc_library( + name = "md5", + srcs = ["md5.cc"], + hdrs = ["md5.h"], + visibility = ["//visibility:public"], +) + +cc_library( + name = "strings", + srcs = ["strings.cc"], + hdrs = [ + # This really belongs into its own library, but that doesn't work on the + # Mac, because of issue #61 (header-only libraries don't build). + "exit_code.h", + "strings.h", + ], + # Automatically propagate the symbol definition to rules depending on this. + defines = [ + "BLAZE_OPENSOURCE", + ], + visibility = ["//visibility:public"], +) diff --git a/src/main/native/BUILD b/src/main/native/BUILD index b1679b73e2..d9d753929a 100644 --- a/src/main/native/BUILD +++ b/src/main/native/BUILD @@ -36,13 +36,12 @@ cc_binary( copts = [ "-fPIC", "-DBLAZE_JAVA_CPU=\"k8\"", - "-DBLAZE_OPENSOURCE=1", ], includes = ["."], # For jni headers. linkshared = 1, visibility = ["//src:__subpackages__"], deps = [ - "//src/main/cpp:md5", + "//src/main/cpp/util:md5", ], ) |