@@ -110,14 +110,29 @@ opts.Add(
110110 map = architecture_aliases ,
111111 )
112112)
113+ opts .Add (
114+ BoolVariable (
115+ key = "platform_tools" ,
116+ help = "If true, auto detect platform build tools and override ones passed in via CC, CXX, RC, etc." ,
117+ default = False ,
118+ )
119+ )
113120
121+ opts .Add ("CXX" , "C++ compiler binary" )
122+ opts .Add ("CC" , "C compiler binary" )
123+ opts .Add ("LINK" , "Linker binary" )
124+ opts .Add ("AS" , "Assembler binary" )
125+ opts .Add ("AR" , "Archiver binary" )
126+ opts .Add ("RANLIB" , "Ranlib binary" )
127+ opts .Add ("RC" , "Resource compiler binary" )
114128opts .Add ("cppdefines" , "Custom defines for the pre-processor" )
115129opts .Add ("ccflags" , "Custom flags for both the C and C++ compilers" )
116130opts .Add ("cxxflags" , "Custom flags for the C++ compiler" )
117131opts .Add ("cflags" , "Custom flags for the C compiler" )
118132opts .Add ("linkflags" , "Custom flags for the linker" )
119133opts .Add ("extra_suffix" , "Custom extra suffix added to the base filename of all generated binary files." , "" )
120134opts .Add (BoolVariable ("use_asan" , "Use address sanitizer (ASAN) in MSVC" , False ))
135+ opts .Add ("import_env_vars" , "A comma-separated list of environment variables to copy from the outer environment." , "" )
121136
122137# Targets flags tool (optimizations, debug symbols)
123138target_tool = Tool ("targets" , toolpath = ["godot-tools" ])
@@ -126,6 +141,12 @@ target_tool.options(opts)
126141opts .Update (env )
127142Help (opts .GenerateHelpText (env ))
128143
144+ # Copy custom environment variables if set.
145+ if env ["import_env_vars" ]:
146+ for env_var in str (env ["import_env_vars" ]).split ("," ):
147+ if env_var in os .environ :
148+ env ["ENV" ][env_var ] = os .environ [env_var ]
149+
129150# Process CPU architecture argument.
130151if env ["arch" ] == "" :
131152 # No architecture specified. Default to arm64 if building for Android,
0 commit comments