@@ -91,6 +91,16 @@ class CCompiler:
9191 }
9292 language_order = ["c++" , "objc" , "c" ]
9393
94+ include_dirs = []
95+ """
96+ include dirs specific to this compiler class
97+ """
98+
99+ library_dirs = []
100+ """
101+ library dirs specific to this compiler class
102+ """
103+
94104 def __init__ (self , verbose = 0 , dry_run = 0 , force = 0 ):
95105 self .dry_run = dry_run
96106 self .force = force
@@ -324,24 +334,7 @@ def set_link_objects(self, objects):
324334
325335 def _setup_compile (self , outdir , macros , incdirs , sources , depends , extra ):
326336 """Process arguments and decide which source files to compile."""
327- if outdir is None :
328- outdir = self .output_dir
329- elif not isinstance (outdir , str ):
330- raise TypeError ("'output_dir' must be a string or None" )
331-
332- if macros is None :
333- macros = self .macros
334- elif isinstance (macros , list ):
335- macros = macros + (self .macros or [])
336- else :
337- raise TypeError ("'macros' (if supplied) must be a list of tuples" )
338-
339- if incdirs is None :
340- incdirs = self .include_dirs
341- elif isinstance (incdirs , (list , tuple )):
342- incdirs = list (incdirs ) + (self .include_dirs or [])
343- else :
344- raise TypeError ("'include_dirs' (if supplied) must be a list of strings" )
337+ outdir , macros , incdirs = self ._fix_compile_args (outdir , macros , incdirs )
345338
346339 if extra is None :
347340 extra = []
@@ -400,6 +393,9 @@ def _fix_compile_args(self, output_dir, macros, include_dirs):
400393 else :
401394 raise TypeError ("'include_dirs' (if supplied) must be a list of strings" )
402395
396+ # add include dirs for class
397+ include_dirs += self .__class__ .include_dirs
398+
403399 return output_dir , macros , include_dirs
404400
405401 def _prep_compile (self , sources , output_dir , depends = None ):
@@ -456,6 +452,9 @@ def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
456452 else :
457453 raise TypeError ("'library_dirs' (if supplied) must be a list of strings" )
458454
455+ # add library dirs for class
456+ library_dirs += self .__class__ .library_dirs
457+
459458 if runtime_library_dirs is None :
460459 runtime_library_dirs = self .runtime_library_dirs
461460 elif isinstance (runtime_library_dirs , (list , tuple )):
0 commit comments