-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved
configure_use_malloc
example to third party examples (#634)
- Loading branch information
1 parent
4e702ae
commit 6202e29
Showing
9 changed files
with
81 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
cmake_crosstool | ||
configure_use_malloc |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
# load("@rules_cc//cc:defs.bzl", "cc_test") | ||
|
||
exports_files( | ||
[ | ||
"BUILD.gperftools.bazel", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# TODO(rules_foreign_cc#227) This currently gives an error: | ||
# "ERROR: <...>/use_malloc/BUILD:17:14: in malloc attribute of cc_test rule //:test: | ||
# configure_make rule '@gperftools//:gperftools_build' is misplaced here (expected cc_library)" | ||
# cc_test( | ||
# name = "malloc_test", | ||
# srcs = ["malloc_test.cpp"], | ||
# malloc = "@gperftools//:gperftools_build", | ||
# ) | ||
|
||
build_test( | ||
name = "build_test", | ||
targets = [ | ||
"@gperftools//:gperftools_build", | ||
], | ||
) | ||
|
||
test_suite( | ||
name = "test", | ||
tests = [ | ||
":build_test", | ||
# ":malloc_test", | ||
], | ||
visibility = ["//:__pkg__"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make") | ||
|
||
filegroup( | ||
name = "all_srcs", | ||
srcs = glob(["**"]), | ||
) | ||
|
||
configure_make( | ||
name = "gperftools_build", | ||
configure_env_vars = select({ | ||
"@platforms//os:macos": {"AR": ""}, | ||
"//conditions:default": {}, | ||
}), | ||
configure_options = [ | ||
"--enable-shared=no", | ||
"--enable-frame-pointers", | ||
"--disable-libunwind", | ||
], | ||
lib_source = ":all_srcs", | ||
out_static_libs = ["libtcmalloc_and_profiler.a"], | ||
visibility = ["//visibility:public"], | ||
) |
14 changes: 14 additions & 0 deletions
14
examples/third_party/gperftools/gperftools_repositories.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
"""A module defining the third party dependency gperftools""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
|
||
def gperftools_repositories(): | ||
maybe( | ||
http_archive, | ||
name = "gperftools", | ||
build_file = Label("//gperftools:BUILD.gperftools.bazel"), | ||
sha256 = "1ee8c8699a0eff6b6a203e59b43330536b22bbcbe6448f54c7091e5efb0763c9", | ||
strip_prefix = "gperftools-2.7", | ||
urls = ["https://github.com/gperftools/gperftools/releases/download/gperftools-2.7/gperftools-2.7.tar.gz"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
int main(int argc, char* argv[]) | ||
{ | ||
std::cout << "Hi there!"; | ||
} | ||
std::cout << "Hi there!"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters