Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bazel support #273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --enable_bzlmod
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.4.0
6 changes: 6 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "xtl",
hdrs = glob(["include/**"]),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
9 changes: 9 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "xtl",
)

bazel_dep(
name = "doctest",
version = "2.4.11",
dev_dependency = True,
)
275 changes: 275 additions & 0 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
cc_test(
name = "test_xbase64",
srcs = [
"test_common_macros.hpp",
"test_xbase64.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xbasic_fixed_string",
srcs = [
"test_common_macros.hpp",
"test_xbasic_fixed_string.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xclosure",
srcs = [
"test_common_macros.hpp",
"test_xclosure.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xcompare",
srcs = [
"test_common_macros.hpp",
"test_xcompare.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xcomplex_sequence",
srcs = [
"test_common_macros.hpp",
"test_xcomplex_sequence.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xcomplex",
srcs = [
"test_common_macros.hpp",
"test_xcomplex.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xdynamic_bitset",
srcs = [
"test_common_macros.hpp",
"test_xdynamic_bitset.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xfunctional",
srcs = [
"test_common_macros.hpp",
"test_xfunctional.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xhalf_float",
srcs = [
"test_common_macros.hpp",
"test_xhalf_float.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xhash",
srcs = [
"test_common_macros.hpp",
"test_xhash.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xhierarchy_generator",
srcs = [
"test_common_macros.hpp",
"test_xhierarchy_generator.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xiterator_base",
srcs = [
"test_common_macros.hpp",
"test_xiterator_base.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xmasked_value",
srcs = [
"test_common_macros.hpp",
"test_xmasked_value.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xmeta_utils",
srcs = [
"test_common_macros.hpp",
"test_xmeta_utils.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xmultimethods",
srcs = [
"test_common_macros.hpp",
"test_xmultimethods.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xoptional",
srcs = [
"test_common_macros.hpp",
"test_xoptional.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xplatform",
srcs = [
"test_common_macros.hpp",
"test_xplatform.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xproxy_wrapper",
srcs = [
"test_common_macros.hpp",
"test_xproxy_wrapper.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xsequence",
srcs = [
"test_common_macros.hpp",
"test_xsequence.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xsystem",
srcs = [
"test_common_macros.hpp",
"test_xsystem.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xtype_traits",
srcs = [
"test_common_macros.hpp",
"test_xtype_traits.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xvariant",
srcs = [
"test_common_macros.hpp",
"test_xvariant.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)

cc_test(
name = "test_xvisitor",
srcs = [
"test_common_macros.hpp",
"test_xvisitor.cpp",
],
deps = [
"//:xtl",
"@doctest//doctest:main",
],
)
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ find_package(Threads)
set(XTL_TESTS
test_xbase64.cpp
test_xbasic_fixed_string.cpp
test_xcomplex.cpp
test_xclosure.cpp
test_xcompare.cpp
test_xcomplex_sequence.cpp
test_xclosure.cpp
test_xcomplex.cpp
test_xdynamic_bitset.cpp
test_xfunctional.cpp
test_xhalf_float.cpp
Expand All @@ -99,11 +99,11 @@ set(XTL_TESTS
test_xmeta_utils.cpp
test_xmultimethods.cpp
test_xoptional.cpp
test_xsequence.cpp
test_xtype_traits.cpp
test_xplatform.cpp
test_xproxy_wrapper.cpp
test_xsequence.cpp
test_xsystem.cpp
test_xtype_traits.cpp
test_xvariant.cpp
test_xvisitor.cpp
)
Expand Down
Loading