@@ -19,11 +19,16 @@ for each translation unit.
1919
2020load ("@rules_cc//cc/common:cc_info.bzl" , "CcInfo" )
2121load ("codechecker_config.bzl" , "get_config_file" )
22+ load (
23+ "common.bzl" ,
24+ "version_specific_attributes" ,
25+ )
2226load (
2327 "compile_commands.bzl" ,
2428 "SourceFilesInfo" ,
2529 "compile_commands_aspect" ,
2630 "compile_commands_impl" ,
31+ "platforms_transition" ,
2732)
2833
2934# buildifier: disable=unused-variable
@@ -261,6 +266,7 @@ per_file_test = rule(
261266 attrs = {
262267 "config" : attr .label (
263268 default = None ,
269+ cfg = platforms_transition ,
264270 doc = "CodeChecker configuration" ,
265271 ),
266272 "default_options" : attr .string_list (
@@ -274,6 +280,10 @@ per_file_test = rule(
274280 default = [],
275281 doc = "List of CodeChecker options, e.g.: --ctu" ,
276282 ),
283+ "platform" : attr .string (
284+ default = "" , #"@platforms//os:linux",
285+ doc = "Platform to build for" ,
286+ ),
277287 "skip" : attr .string_list (
278288 default = [],
279289 doc = "List of skip/ignore file rules. " +
@@ -283,6 +293,7 @@ per_file_test = rule(
283293 aspects = [
284294 compile_commands_aspect ,
285295 ],
296+ cfg = platforms_transition ,
286297 doc = "List of compilable targets which should be checked." ,
287298 ),
288299 "toolchain" : attr .label (
@@ -297,7 +308,7 @@ per_file_test = rule(
297308 cfg = "target" ,
298309 default = ":per_file_script" ,
299310 ),
300- },
311+ } | version_specific_attributes () ,
301312 outputs = {
302313 "compile_commands" : "%{name}/compile_commands.json" ,
303314 "test_script" : "%{name}/test_script.sh" ,
0 commit comments