@@ -17,7 +17,8 @@ def rules_foreign_cc_dependencies(
17
17
register_preinstalled_tools = True ,
18
18
register_built_tools = True ,
19
19
register_toolchains = True ,
20
- register_built_pkgconfig_toolchain = True ):
20
+ register_built_pkgconfig_toolchain = True ,
21
+ register_repos = True ):
21
22
"""Call this function from the WORKSPACE file to initialize rules_foreign_cc \
22
23
dependencies and let neccesary code generation happen \
23
24
(Code generation is needed to support different variants of the C++ Starlark API.).
@@ -59,6 +60,10 @@ def rules_foreign_cc_dependencies(
59
60
startup --windows_enable_symlinks -> This is required to enable symlinking to avoid long runfile paths
60
61
build --action_env=MSYS=winsymlinks:nativestrict -> This is required to enable symlinking to avoid long runfile paths
61
62
startup --output_user_root=C:/b -> This is required to keep paths as short as possible
63
+
64
+ register_repos: If true, use repository rules to register the required
65
+ dependencies. (If you are using bzlmod, you probably do not want to set
66
+ this since it will create shadow copies of these repos)
62
67
"""
63
68
64
69
register_framework_toolchains (register_toolchains = register_toolchains )
@@ -83,6 +88,9 @@ def rules_foreign_cc_dependencies(
83
88
if register_preinstalled_tools :
84
89
preinstalled_toolchains ()
85
90
91
+ if not register_repos :
92
+ return
93
+
86
94
maybe (
87
95
http_archive ,
88
96
name = "bazel_features" ,
0 commit comments