mirror of
https://github.com/fastfloat/fast_float.git
synced 2025-12-06 08:46:49 +08:00
Add Bazel build rules.
This commit is contained in:
parent
7665574628
commit
d65285a48c
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@ build/*
|
||||
Testing/*
|
||||
.cache/
|
||||
compile_commands.json
|
||||
bazel-*
|
||||
|
||||
# Visual studio
|
||||
.vs/
|
||||
|
||||
6
BUILD.bazel
Normal file
6
BUILD.bazel
Normal file
@ -0,0 +1,6 @@
|
||||
cc_library(
|
||||
name = "fast_float",
|
||||
hdrs = glob(["include/fast_float/*.h"]),
|
||||
strip_include_prefix = "include",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
9
MODULE.bazel
Normal file
9
MODULE.bazel
Normal file
@ -0,0 +1,9 @@
|
||||
"""fast_float number parsing library: 4x faster than strtod"""
|
||||
|
||||
module(
|
||||
name = "fast_float",
|
||||
version = "6.1.6",
|
||||
compatibility_level = 6,
|
||||
)
|
||||
|
||||
bazel_dep(name = "doctest", version = "2.4.11", dev_dependency = True)
|
||||
98
tests/BUILD.bazel
Normal file
98
tests/BUILD.bazel
Normal file
@ -0,0 +1,98 @@
|
||||
cc_test(
|
||||
name = "basictest",
|
||||
srcs = ["basictest.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "example_test",
|
||||
srcs = ["example_test.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "example_comma_test",
|
||||
srcs = ["example_comma_test.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "fast_int",
|
||||
srcs = ["fast_int.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "fixedwidthtest",
|
||||
srcs = ["fixedwidthtest.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "fortran",
|
||||
srcs = ["fortran.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "json_fmt",
|
||||
srcs = ["json_fmt.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "long_test",
|
||||
srcs = ["long_test.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "powersoffive_hardround",
|
||||
srcs = ["powersoffive_hardround.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "rcppfastfloat_test",
|
||||
srcs = ["rcppfastfloat_test.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "string_test",
|
||||
srcs = ["string_test.cpp"],
|
||||
deps = [
|
||||
"//:fast_float",
|
||||
"@doctest//doctest",
|
||||
],
|
||||
)
|
||||
@ -1,6 +1,6 @@
|
||||
#define DOCTEST_CONFIG_SUPER_FAST_ASSERTS
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include <doctest/doctest.h>
|
||||
#include "doctest/doctest.h"
|
||||
|
||||
#include "fast_float/fast_float.h"
|
||||
#include <cmath>
|
||||
|
||||
@ -4,7 +4,10 @@
|
||||
#include <cstring>
|
||||
#include "fast_float/fast_float.h"
|
||||
#include <cstdint>
|
||||
|
||||
#if __cplusplus >= 202300L
|
||||
#include <stdfloat>
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
// Write some testcases for the parsing of floating point numbers in the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user