From bb889d4d312eb15c23908c8074e5da7aa74b8af3 Mon Sep 17 00:00:00 2001 From: Sergey Yagovtsev Date: Mon, 2 Dec 2019 19:51:25 +0300 Subject: [PATCH] Add bazel build for easy profiler core --- .gitignore | 2 ++ WORKSPACE | 0 easy_profiler_core/BUILD | 13 +++++++++++++ .../easy/details/arbitrary_value_public_types.h | 1 + easy_profiler_core/profiler.cpp | 2 +- sample/BUILD | 7 +++++++ 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 WORKSPACE create mode 100644 easy_profiler_core/BUILD create mode 100644 sample/BUILD diff --git a/.gitignore b/.gitignore index 2c300a0..4de9761 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ bin *build* +!BUILD .* *.user /*.prof .idea/ +bazel* diff --git a/WORKSPACE b/WORKSPACE new file mode 100644 index 0000000..e69de29 diff --git a/easy_profiler_core/BUILD b/easy_profiler_core/BUILD new file mode 100644 index 0000000..d9b28a3 --- /dev/null +++ b/easy_profiler_core/BUILD @@ -0,0 +1,13 @@ +cc_library( + name = "easy_profiler", + srcs = glob(["**/*.cpp", "**/*.h"]), + hdrs = glob(["include/**"]), + includes = ["include", "."], + visibility = ["//visibility:public"], + defines = [ + "EASY_PROFILER_VERSION_MAJOR=2", + "EASY_PROFILER_VERSION_MINOR=1", + "EASY_PROFILER_VERSION_PATCH=0", + "BUILD_WITH_EASY_PROFILER=1", + ] +) \ No newline at end of file diff --git a/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h b/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h index 58c1c17..c1dd975 100644 --- a/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h +++ b/easy_profiler_core/include/easy/details/arbitrary_value_public_types.h @@ -45,6 +45,7 @@ The Apache License, Version 2.0 (the "License"); #include #include +#include #include namespace profiler diff --git a/easy_profiler_core/profiler.cpp b/easy_profiler_core/profiler.cpp index 356edd4..cb13be2 100644 --- a/easy_profiler_core/profiler.cpp +++ b/easy_profiler_core/profiler.cpp @@ -303,7 +303,7 @@ PROFILER_API const profiler::BaseBlockDescriptor* registerDescription(profiler:: const char*, const char*, int, profiler::block_type_t, profiler::color_t, bool) { - return reinterpret_cast(0xbad); + return reinterpret_cast(0xbad); } PROFILER_API void endBlock() { } diff --git a/sample/BUILD b/sample/BUILD new file mode 100644 index 0000000..b5ee007 --- /dev/null +++ b/sample/BUILD @@ -0,0 +1,7 @@ +cc_binary( + name = "easy_profiler_sample", + srcs = ["main.cpp"], + deps = [ + "//easy_profiler_core:easy_profiler", + ], +) \ No newline at end of file