Skip to content

Commit a6b8537

Browse files
committed
Use defs from rules_cc
1 parent cec6a27 commit a6b8537

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

cc/defs.bzl

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
"""Swift wrappers for native cc rules."""
1212

13+
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test", "cc_binary")
1314
load("//stamp:stamp_file.bzl", "stamp_file")
1415
load(":cc_static_library.bzl", _cc_static_library = "cc_static_library")
1516
load(":copts.bzl", "DEFAULT_COPTS", "GCC5_COPTS", "GCC6_COPTS")
@@ -246,7 +247,7 @@ def swift_c_library(**kwargs):
246247

247248
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
248249

249-
native.cc_library(**kwargs)
250+
cc_library(**kwargs)
250251

251252
def swift_cc_library(**kwargs):
252253
"""Wraps cc_library to enforce standards for a production c++ library.
@@ -299,7 +300,7 @@ def swift_cc_library(**kwargs):
299300

300301
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
301302

302-
native.cc_library(**kwargs)
303+
cc_library(**kwargs)
303304

304305
def swift_c_tool_library(**kwargs):
305306
"""Wraps cc_library to enforce standards for a non-production c library.
@@ -343,7 +344,7 @@ def swift_c_tool_library(**kwargs):
343344

344345
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
345346

346-
native.cc_library(**kwargs)
347+
cc_library(**kwargs)
347348

348349
def swift_cc_tool_library(**kwargs):
349350
"""Wraps cc_library to enforce standards for a non-production c++ library.
@@ -390,7 +391,7 @@ def swift_cc_tool_library(**kwargs):
390391

391392
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
392393

393-
native.cc_library(**kwargs)
394+
cc_library(**kwargs)
394395

395396
def swift_c_binary(**kwargs):
396397
"""Wraps cc_binary to enforce standards for a production c binary.
@@ -438,7 +439,7 @@ def swift_c_binary(**kwargs):
438439

439440
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
440441

441-
native.cc_binary(**kwargs)
442+
cc_binary(**kwargs)
442443

443444
def swift_cc_binary(**kwargs):
444445
"""Wraps cc_binary to enforce standards for a production c++ binary.
@@ -488,7 +489,7 @@ def swift_cc_binary(**kwargs):
488489

489490
kwargs["tags"] = [BINARY] + kwargs.get("tags", [])
490491

491-
native.cc_binary(**kwargs)
492+
cc_binary(**kwargs)
492493

493494
def swift_c_tool(**kwargs):
494495
"""Wraps cc_binary to enforce standards for a non-production c binary.
@@ -531,7 +532,7 @@ def swift_c_tool(**kwargs):
531532

532533
kwargs["env"] = _symbolizer_env(kwargs.get("env", {}))
533534

534-
native.cc_binary(**kwargs)
535+
cc_binary(**kwargs)
535536

536537
def swift_cc_tool(**kwargs):
537538
"""Wraps cc_binary to enforce standards for a non-production c++ binary.
@@ -577,7 +578,7 @@ def swift_cc_tool(**kwargs):
577578

578579
kwargs["env"] = _symbolizer_env(kwargs.get("env", {}))
579580

580-
native.cc_binary(**kwargs)
581+
cc_binary(**kwargs)
581582

582583
def swift_c_test_library(**kwargs):
583584
"""Wraps cc_library to enforce Swift test library conventions.
@@ -604,7 +605,7 @@ def swift_c_test_library(**kwargs):
604605
kwargs["tags"] = [TEST_LIBRARY] + kwargs.get("tags", [])
605606
kwargs["target_compatible_with"] = kwargs.get("target_compatible_with", []) + _test_compatible_with()
606607

607-
native.cc_library(**kwargs)
608+
cc_library(**kwargs)
608609

609610
def swift_cc_test_library(**kwargs):
610611
"""Wraps cc_library to enforce Swift test library conventions.
@@ -635,7 +636,7 @@ def swift_cc_test_library(**kwargs):
635636

636637
kwargs["linkstatic"] = _link_static(kwargs.get("linkstatic", True))
637638

638-
native.cc_library(**kwargs)
639+
cc_library(**kwargs)
639640

640641
def swift_c_test(name, type, **kwargs):
641642
"""Wraps cc_test to enforce Swift testing conventions for C code.
@@ -690,7 +691,7 @@ def swift_c_test(name, type, **kwargs):
690691
kwargs["tags"] = [TEST, type] + kwargs.get("tags", [])
691692
kwargs["target_compatible_with"] = kwargs.get("target_compatible_with", []) + _test_compatible_with()
692693

693-
native.cc_test(**kwargs)
694+
cc_test(**kwargs)
694695

695696
def swift_cc_test(name, type, **kwargs):
696697
"""Wraps cc_test to enforce Swift testing conventions.
@@ -742,4 +743,4 @@ def swift_cc_test(name, type, **kwargs):
742743
kwargs["tags"] = [TEST, type] + kwargs.get("tags", [])
743744
kwargs["target_compatible_with"] = kwargs.get("target_compatible_with", []) + _test_compatible_with()
744745

745-
native.cc_test(**kwargs)
746+
cc_test(**kwargs)

0 commit comments

Comments
 (0)