Fix approach to include paths.
This accommodates bazel's best practices a bit better.
This commit is contained in:
parent
9164e7dc60
commit
2a4c819f4f
8
include/BUILD
Normal file
8
include/BUILD
Normal file
@ -0,0 +1,8 @@
|
||||
# This rule is mainly used to expose parselink includes in a _somewhat_ sane
|
||||
# manner while conforming to my stylistic preferences.
|
||||
|
||||
cc_library(
|
||||
name = "path",
|
||||
includes = ["."],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
29
include/parselink/BUILD
Normal file
29
include/parselink/BUILD
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
cc_library(
|
||||
name = "msgpack",
|
||||
hdrs = glob(["msgpack/**/*.h"]),
|
||||
includes = ["."],
|
||||
deps = ["@expected", "//include:path"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "logging",
|
||||
hdrs = glob(["logging.h", "logging/**/*.h"]),
|
||||
includes = ["."],
|
||||
deps = ["@fmt", "@magic_enum", "//include:path"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "utility",
|
||||
hdrs = glob(["utility/**/*.h"]),
|
||||
includes = ["."],
|
||||
deps = ["//include:path"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
exports_files(
|
||||
["server.h"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
@ -1,6 +1,7 @@
|
||||
#ifndef msgpack_core_2e1a9d55129a666e
|
||||
#define msgpack_core_2e1a9d55129a666e
|
||||
|
||||
#include "core/error.h"
|
||||
#include "core/format.h"
|
||||
#include "core/reader.h"
|
||||
#include "core/writer.h"
|
||||
@ -1,6 +1,7 @@
|
||||
#ifndef msgpack_9865a64955e64703
|
||||
#define msgpack_9865a64955e64703
|
||||
|
||||
#include "msgpack/core.h"
|
||||
#include "core.h"
|
||||
#include "token.h"
|
||||
|
||||
#endif // msgpack_9865a64955e64703
|
||||
22
source/BUILD
22
source/BUILD
@ -1,26 +1,11 @@
|
||||
cc_library(
|
||||
name = "headers",
|
||||
hdrs = [
|
||||
"include/parselink/utility/argparse.h",
|
||||
"include/parselink/server.h",
|
||||
"//include/parselink:server.h",
|
||||
],
|
||||
strip_include_prefix = "include/parselink",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "msgpack",
|
||||
hdrs = glob([
|
||||
"include/parselink/msgpack/**/*.h"
|
||||
]),
|
||||
deps = [
|
||||
"@expected",
|
||||
],
|
||||
strip_include_prefix = "include/parselink",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
||||
cc_binary(
|
||||
name = "parselinkd",
|
||||
srcs = [
|
||||
@ -29,8 +14,9 @@ cc_binary(
|
||||
],
|
||||
deps = [
|
||||
"headers",
|
||||
"msgpack",
|
||||
"//include/parselink:msgpack",
|
||||
"//source/logging",
|
||||
"//include/parselink:utility",
|
||||
"@boost//:beast",
|
||||
"//source/common",
|
||||
],
|
||||
)
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
# parselink
|
||||
|
||||
cc_library(
|
||||
name = "common",
|
||||
srcs = [
|
||||
"source/logging.cpp",
|
||||
],
|
||||
hdrs = [
|
||||
"include/logging.h",
|
||||
"include/logging/level.h",
|
||||
"include/logging/formatters.h",
|
||||
"include/logging/theme.h",
|
||||
"include/logging/traits.h",
|
||||
],
|
||||
linkstatic = True,
|
||||
includes = ["include"],
|
||||
deps = [
|
||||
"@fmt//:fmt",
|
||||
"@magic_enum//:magic_enum",
|
||||
],
|
||||
visibility = [
|
||||
# TODO: Fix visibility
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
||||
16
source/logging/BUILD
Normal file
16
source/logging/BUILD
Normal file
@ -0,0 +1,16 @@
|
||||
# parselink
|
||||
|
||||
cc_library(
|
||||
name = "logging",
|
||||
srcs = [
|
||||
"logging.cpp",
|
||||
],
|
||||
linkstatic = True,
|
||||
deps = [
|
||||
"//include/parselink:logging",
|
||||
],
|
||||
visibility = [
|
||||
# TODO: Fix visibility
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
||||
@ -16,7 +16,7 @@
|
||||
// License TBD.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "logging.h"
|
||||
#include "parselink/logging.h"
|
||||
|
||||
#include <fmt/chrono.h>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <logging.h>
|
||||
#include "parselink/logging.h"
|
||||
#include <utility/argparse.h>
|
||||
#include <server.h>
|
||||
|
||||
|
||||
@ -18,8 +18,8 @@
|
||||
// License TBD.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <logging.h>
|
||||
#include <parselink/server.h>
|
||||
#include "parselink/logging.h"
|
||||
#include "parselink/server.h"
|
||||
|
||||
#include <boost/asio/io_context.hpp>
|
||||
#include <boost/asio/signal_set.hpp>
|
||||
|
||||
@ -2,7 +2,7 @@ cc_test(
|
||||
name = "logging",
|
||||
srcs = ["logging.cpp"],
|
||||
deps = [
|
||||
"//source/common",
|
||||
"//source/logging",
|
||||
"@ut",
|
||||
],
|
||||
)
|
||||
@ -16,7 +16,7 @@
|
||||
// License TBD.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <logging.h>
|
||||
#include "parselink/logging.h"
|
||||
|
||||
#include <boost/ut.hpp>
|
||||
|
||||
@ -6,7 +6,7 @@ cc_library(
|
||||
"rng.h"
|
||||
],
|
||||
deps = [
|
||||
"//source:msgpack",
|
||||
"//include/parselink:msgpack",
|
||||
"@expected",
|
||||
"@fmt",
|
||||
"@magic_enum",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <msgpack/core/reader.h>
|
||||
#include "parselink/msgpack/core/reader.h"
|
||||
|
||||
#include <boost/ut.hpp>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <msgpack/core/reader.h>
|
||||
#include "parselink/msgpack/core/reader.h"
|
||||
#include "rng.h"
|
||||
|
||||
#include <boost/ut.hpp>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <msgpack/token.h>
|
||||
#include "parselink/msgpack/token.h"
|
||||
|
||||
#include <boost/ut.hpp>
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include <msgpack/core/writer.h>
|
||||
#include "parselink/msgpack/core/writer.h"
|
||||
|
||||
#include <boost/ut.hpp>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user