@@ -204,9 +204,11 @@ def __init__(self) -> None:
204204
205205 def cmd_build (self ):
206206 wheel_dir = self .args .get ("wheel" , DIST_DIR )
207+ quiet = self .args .get ("quiet" , False )
207208 debug = self .args .get ("debug" , False )
208209 lax = self .args .get ("lax" , False )
209210 sdl3 = self .args .get ("sdl3" , False )
211+ sanitize = self .args .get ("sanitize" )
210212 coverage = self .args .get ("coverage" , False )
211213 if wheel_dir and coverage :
212214 pprint ("Cannot pass --wheel and --coverage together" , Colors .RED )
@@ -228,6 +230,8 @@ def cmd_build(self):
228230
229231 if not wheel_dir :
230232 # editable install
233+ if not quiet :
234+ install_args .append ("-Ceditable-verbose=true" )
231235 install_args .append ("--editable" )
232236
233237 install_args .append ("." )
@@ -245,6 +249,9 @@ def cmd_build(self):
245249 if coverage :
246250 install_args .extend (COVERAGE_ARGS )
247251
252+ if sanitize :
253+ install_args .append (f"-Csetup-args=-Db_sanitize={ sanitize } " )
254+
248255 info_str = f"with { debug = } , { lax = } , { sdl3 = } , and { coverage = } "
249256 if wheel_dir :
250257 pprint (f"Building wheel at '{ wheel_dir } ' ({ info_str } )" )
@@ -352,6 +359,11 @@ def parse_args(self):
352359 f"wheel (if not passed, '{ DIST_DIR } ' is used)"
353360 ),
354361 )
362+ build_parser .add_argument (
363+ "--quiet" ,
364+ action = "store_true" ,
365+ help = "Silence build log in editable install (doing editable-verbose=false)" ,
366+ )
355367 build_parser .add_argument (
356368 "--debug" ,
357369 action = "store_true" ,
@@ -367,6 +379,20 @@ def parse_args(self):
367379 action = "store_true" ,
368380 help = "Build against SDL3 instead of the default SDL2" ,
369381 )
382+ build_parser .add_argument (
383+ "--sanitize" ,
384+ choices = [
385+ "address" ,
386+ "undefined" ,
387+ "address,undefined" ,
388+ "leak" ,
389+ "thread" ,
390+ "memory" ,
391+ "none" ,
392+ ],
393+ default = "none" ,
394+ help = "Enable compiler sanitizers. Defaults to 'none'." ,
395+ )
370396 build_parser .add_argument (
371397 "--coverage" ,
372398 action = "store_true" ,
0 commit comments