-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compared to `1.15.0.bcr.1`, add a `bool_flag` for header_only mode and now depends on `@bazel_skylib`. This enables `--@spdlog//:header_only=False` on the bazel command line. --- See also #1769 which requests a mechanism to enable `USE_STD_FORMAT`. If desirable, I could try adding that option as an additional flag in this pull request, or in a follow-up change.
- Loading branch information
1 parent
750c013
commit f17276d
Showing
6 changed files
with
168 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module( | ||
name = "spdlog", | ||
version = "1.15.0.bcr.2", | ||
compatibility_level = 1, | ||
bazel_compatibility = [">=7.2.1"], | ||
) | ||
|
||
bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
bazel_dep(name = "fmt", version = "11.0.2") | ||
bazel_dep(name = "rules_cc", version = "0.1.0") | ||
|
||
bazel_dep(name = "catch2", version = "3.7.1", dev_dependency = True) |
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,99 @@ | ||
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag") | ||
load("@rules_cc//cc:defs.bzl", "cc_library") | ||
|
||
bool_flag( | ||
name = "header_only", | ||
build_setting_default = True, | ||
) | ||
|
||
config_setting( | ||
name = "header_only_true", | ||
flag_values = { | ||
":header_only": "True", | ||
}, | ||
) | ||
|
||
SRCS = glob( | ||
[ | ||
"src/*.cpp", | ||
], | ||
exclude = [ | ||
"src/bundled*", | ||
], | ||
) | ||
|
||
HDRS = glob( | ||
[ | ||
"include/**/*.h", | ||
], | ||
exclude = [ | ||
"include/**/*-inl.h", | ||
"include/spdlog/fmt/bundled/**", | ||
], | ||
) | ||
|
||
INLS = glob( | ||
[ | ||
"include/**/*-inl.h", | ||
], | ||
exclude = [ | ||
"include/spdlog/fmt/bundled/**", | ||
], | ||
) | ||
|
||
cc_library( | ||
name = "spdlog", | ||
srcs = select({ | ||
":header_only_true": [], | ||
"//conditions:default": SRCS + INLS, | ||
}), | ||
hdrs = select({ | ||
":header_only_true": HDRS + INLS, | ||
"//conditions:default": HDRS, | ||
}), | ||
defines = ["SPDLOG_FMT_EXTERNAL"] + select({ | ||
":header_only_true": [], | ||
"//conditions:default": ["SPDLOG_COMPILED_LIB"], | ||
}), | ||
includes = ["include"], | ||
visibility = ["//visibility:public"], | ||
deps = ["@fmt"], | ||
) | ||
|
||
cc_test( | ||
name = "spdlog_test", | ||
srcs = [ | ||
"tests/includes.h", | ||
"tests/main.cpp", | ||
"tests/test_async.cpp", | ||
"tests/test_backtrace.cpp", | ||
"tests/test_bin_to_hex.cpp", | ||
"tests/test_cfg.cpp", | ||
"tests/test_circular_q.cpp", | ||
"tests/test_create_dir.cpp", | ||
"tests/test_custom_callbacks.cpp", | ||
"tests/test_daily_logger.cpp", | ||
"tests/test_dup_filter.cpp", | ||
"tests/test_errors.cpp", | ||
"tests/test_eventlog.cpp", | ||
"tests/test_file_helper.cpp", | ||
"tests/test_file_logging.cpp", | ||
"tests/test_fmt_helper.cpp", | ||
"tests/test_macros.cpp", | ||
"tests/test_misc.cpp", | ||
"tests/test_mpmc_q.cpp", | ||
"tests/test_pattern_formatter.cpp", | ||
"tests/test_registry.cpp", | ||
"tests/test_sink.h", | ||
"tests/test_stdout_api.cpp", | ||
"tests/test_stopwatch.cpp", | ||
"tests/test_systemd.cpp", | ||
"tests/test_time_point.cpp", | ||
"tests/utils.cpp", | ||
"tests/utils.h", | ||
], | ||
deps = [ | ||
":spdlog", | ||
"@catch2//:catch2_main", | ||
], | ||
) |
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 @@ | ||
../MODULE.bazel |
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,44 @@ | ||
matrix: | ||
unix_platform: | ||
- debian10 | ||
- debian11 | ||
- macos | ||
- macos_arm64 | ||
- ubuntu2004 | ||
- ubuntu2204 | ||
- ubuntu2404 | ||
windows_platform: | ||
- windows | ||
bazel: [7.x, 8.x, rolling] | ||
tasks: | ||
unix_test_header: | ||
name: Verify unix build targets (header only) | ||
platform: ${{ unix_platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "@spdlog//:spdlog" | ||
unix_test_compiled: | ||
name: Verify unix build targets (compiled lib) | ||
platform: ${{ unix_platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "@spdlog//:spdlog" | ||
build_flags: | ||
- "--@spdlog//:header_only=False" | ||
windows_test_header: | ||
name: Verify windows build targets (header only) | ||
platform: ${{ windows_platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "@spdlog//:spdlog" | ||
build_flags: | ||
- --cxxopt=/utf-8 | ||
windows_test_compiled: | ||
name: Verify windows build targets (compiled lib) | ||
platform: ${{ windows_platform }} | ||
bazel: ${{ bazel }} | ||
build_targets: | ||
- "@spdlog//:spdlog" | ||
build_flags: | ||
- "--@spdlog//:header_only=False" | ||
- "--cxxopt=/utf-8" |
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,10 @@ | ||
{ | ||
"url": "https://github.com/gabime/spdlog/archive/refs/tags/v1.15.0.tar.gz", | ||
"integrity": "sha256-mWJkjJtPGnu8dv2NkXJVW60Ycf2xT/T4Qu+HlJaCyqU=", | ||
"strip_prefix": "spdlog-1.15.0", | ||
"patch_strip": 0, | ||
"overlay": { | ||
"BUILD.bazel": "sha256-wNMOpyEN4/Ha4jzPkEZLMfeeUMc7dseTSPBuyEbtwFo=", | ||
"MODULE.bazel": "sha256-QgHJhtv7+qyUprpajwpdjqyLBjcevKNq0J6OOTUT47g=" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -23,7 +23,8 @@ | |
"1.14.0", | ||
"1.14.1", | ||
"1.15.0", | ||
"1.15.0.bcr.1" | ||
"1.15.0.bcr.1", | ||
"1.15.0.bcr.2" | ||
], | ||
"yanked_versions": {} | ||
} |