1313
1414load ("@rules_cc//cc:defs.bzl" , "cc_library" , "cc_test" )
1515load ("@score_baselibs//:bazel/unit_tests.bzl" , "cc_unit_test_suites_for_host_and_qnx" )
16- load (":custom.bzl" , "load_custom_targets" , "load_custom_test_suites" )
1716
1817COMPILER_WARNING_FEATURES = [
1918 "treat_warnings_as_errors" ,
2019 "strict_warnings" ,
2120 "additional_warnings" ,
2221]
2322
23+ cc_library (
24+ name = "factory_headers" ,
25+ hdrs = [
26+ "hash_calculator_factory.h" ,
27+ "safe_hash_calculator_factory.h" ,
28+ ],
29+ visibility = ["//visibility:public" ],
30+ deps = [
31+ "@score_baselibs//score/hash/code/core/factory" ,
32+ "@score_baselibs//score/hash/code/openssl:openssl_cal" ,
33+ ],
34+ )
35+
2436cc_library (
2537 name = "hash_impl_ieee" ,
2638 srcs = [
@@ -57,8 +69,13 @@ cc_library(
5769 ],
5870)
5971
60- # Other options:
61- # "@score_baselibs//score/hash/code/core/factory/impl:hash_impl_autosar"
72+ # Extension point:
73+ # `crc_variant` and `safe_crc_variant` are provided as extension points,
74+ # meaning that one may replace them with custom implementations that
75+ # provide different polynomials. To do so, define alternate `cc_library`
76+ # targets that reuse the generic CRC implementation pattern from
77+ # `//score/hash/code/crc:crc_ieee`, provide the desired polynomial
78+ # configuration, and override these two targets in `.bazelrc`.
6279label_flag (
6380 name = "crc_variant" ,
6481 build_setting_default = ":hash_impl_ieee" ,
@@ -67,8 +84,6 @@ label_flag(
6784 ],
6885)
6986
70- # Other options:
71- # "@score_baselibs//score/hash/code/core/factory/impl:safe_hash_impl_autosar"
7287label_flag (
7388 name = "safe_crc_variant" ,
7489 build_setting_default = ":safe_hash_impl_ieee" ,
@@ -96,8 +111,6 @@ cc_test(
96111
97112cc_unit_test_suites_for_host_and_qnx (
98113 name = "unit_tests" ,
99- cc_unit_tests = [":unit_test" ] + load_custom_test_suites () ,
100- visibility = ["//visibility:public" ], # platform_only
114+ cc_unit_tests = [":unit_test" ],
115+ visibility = ["//visibility:public" ],
101116)
102-
103- load_custom_targets ()
0 commit comments