File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,17 +32,18 @@ def csharp_library_impl(ctx: AnalysisContext) -> list[Provider]:
3232 format = "/out:{}" ,
3333 ))
3434
35- # Don't include any default .NET framework assemblies like "mscorlib" or "System" unless
36- # explicitly requested with `/reference:{}`. This flag also stops injection of other
37- # default compiler flags.
38- cmd .append ("/noconfig" )
39-
40- # Don't reference mscorlib.dll unless asked for. This is required for targets that target
41- # embedded platforms such as Silverlight or WASM. (Originally for Buck1 compatibility.)
42- cmd .append ("/nostdlib" )
43-
44- # Don't search any paths for .NET libraries unless explicitly referenced with `/lib:{}`.
45- cmd .append ("/nosdkpath" )
35+ if ctx .attrs .add_hermetic_arguments :
36+ # Don't include any default .NET framework assemblies like "mscorlib" or "System" unless
37+ # explicitly requested with `/reference:{}`. This flag also stops injection of other
38+ # default compiler flags.
39+ cmd .append ("/noconfig" )
40+
41+ # Don't reference mscorlib.dll unless asked for. This is required for targets that target
42+ # embedded platforms such as Silverlight or WASM. (Originally for Buck1 compatibility.)
43+ cmd .append ("/nostdlib" )
44+
45+ # Don't search any paths for .NET libraries unless explicitly referenced with `/lib:{}`.
46+ cmd .append ("/nosdkpath" )
4647
4748 # Let csc know the directory path where it can find system assemblies. This is the path
4849 # that is searched by `/reference:{libname}` if `libname` is just a DLL name.
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ csharp_library = prelude_rule(
7878 "compiler_flags" : attrs .list (attrs .string (), default = [], doc = """
7979 The set of additional compiler flags to pass to the compiler.
8080 """ ),
81+ "add_hermetic_arguments" : attrs .bool (default = True ),
8182 } |
8283 buck .licenses_arg () |
8384 buck .labels_arg () |
You can’t perform that action at this time.
0 commit comments