@ -30,6 +30,7 @@ from .compilers import (
from . mixins . gnu import GnuCompiler
from . mixins . gnu import GnuCompiler
if T . TYPE_CHECKING :
if T . TYPE_CHECKING :
from . . dependencies import ExternalProgram
from . . envconfig import MachineInfo
from . . envconfig import MachineInfo
d_feature_args = { ' gcc ' : { ' unittest ' : ' -funittest ' ,
d_feature_args = { ' gcc ' : { ' unittest ' : ' -funittest ' ,
@ -442,13 +443,13 @@ class DCompiler(Compiler):
language = ' d '
language = ' d '
def __init__ ( self , exelist , version , for_machine : MachineChoice ,
def __init__ ( self , exelist : T . List [ str ] , version : str , for_machine : MachineChoice ,
info : ' MachineInfo ' , arch , is_cross , exe_wrapper , * * kwargs ) :
info : ' MachineInfo ' , arch : str , exe_wrapper : T . Optional [ ' ExternalProgram ' ] = None ,
* * kwargs ) :
super ( ) . __init__ ( exelist , version , for_machine , info , * * kwargs )
super ( ) . __init__ ( exelist , version , for_machine , info , * * kwargs )
self . id = ' unknown '
self . id = ' unknown '
self . arch = arch
self . arch = arch
self . exe_wrapper = exe_wrapper
self . exe_wrapper = exe_wrapper
self . is_cross = is_cross
def sanity_check ( self , work_dir , environment ) :
def sanity_check ( self , work_dir , environment ) :
source_name = os . path . join ( work_dir , ' sanity.d ' )
source_name = os . path . join ( work_dir , ' sanity.d ' )
@ -639,9 +640,10 @@ class GnuDCompiler(GnuCompiler, DCompiler):
# we mostly want DCompiler, but that gives us the Compiler.LINKER_PREFIX instead
# we mostly want DCompiler, but that gives us the Compiler.LINKER_PREFIX instead
LINKER_PREFIX = GnuCompiler . LINKER_PREFIX
LINKER_PREFIX = GnuCompiler . LINKER_PREFIX
def __init__ ( self , exelist , version , for_machine : MachineChoice ,
def __init__ ( self , exelist : T . List [ str ] , version : str , for_machine : MachineChoice ,
info : ' MachineInfo ' , is_cross , exe_wrapper , arch , * * kwargs ) :
info : ' MachineInfo ' , arch : str , * , exe_wrapper : T . Optional [ ' ExternalProgram ' ] = None ,
DCompiler . __init__ ( self , exelist , version , for_machine , info , is_cross , exe_wrapper , arch , * * kwargs )
* * kwargs ) :
DCompiler . __init__ ( self , exelist , version , for_machine , info , arch , exe_wrapper = exe_wrapper , * * kwargs )
GnuCompiler . __init__ ( self , { } )
GnuCompiler . __init__ ( self , { } )
self . id = ' gcc '
self . id = ' gcc '
default_warn_args = [ ' -Wall ' , ' -Wdeprecated ' ]
default_warn_args = [ ' -Wall ' , ' -Wdeprecated ' ]
@ -695,9 +697,9 @@ class GnuDCompiler(GnuCompiler, DCompiler):
class LLVMDCompiler ( DmdLikeCompilerMixin , DCompiler ) :
class LLVMDCompiler ( DmdLikeCompilerMixin , DCompiler ) :
def __init__ ( self , exelist , version , for_machine : MachineChoice ,
def __init__ ( self , exelist : T . List [ str ] , version : str , for_machine : MachineChoice ,
info : ' MachineInfo ' , arch , * * kwargs ) :
info : ' MachineInfo ' , arch : str , * * kwargs ) :
DCompiler . __init__ ( self , exelist , version , for_machine , info , arch , False , None , * * kwargs )
DCompiler . __init__ ( self , exelist , version , for_machine , info , arch , * * kwargs )
self . id = ' llvm '
self . id = ' llvm '
self . base_options = [ ' b_coverage ' , ' b_colorout ' , ' b_vscrt ' , ' b_ndebug ' ]
self . base_options = [ ' b_coverage ' , ' b_colorout ' , ' b_vscrt ' , ' b_ndebug ' ]
@ -747,9 +749,9 @@ class LLVMDCompiler(DmdLikeCompilerMixin, DCompiler):
class DmdDCompiler ( DmdLikeCompilerMixin , DCompiler ) :
class DmdDCompiler ( DmdLikeCompilerMixin , DCompiler ) :
def __init__ ( self , exelist , version , for_machine : MachineChoice ,
def __init__ ( self , exelist : T . List [ str ] , version : str , for_machine : MachineChoice ,
info : ' MachineInfo ' , arch , * * kwargs ) :
info : ' MachineInfo ' , arch : str , * * kwargs ) :
DCompiler . __init__ ( self , exelist , version , for_machine , info , arch , False , None , * * kwargs )
DCompiler . __init__ ( self , exelist , version , for_machine , info , arch , * * kwargs )
self . id = ' dmd '
self . id = ' dmd '
self . base_options = [ ' b_coverage ' , ' b_colorout ' , ' b_vscrt ' , ' b_ndebug ' ]
self . base_options = [ ' b_coverage ' , ' b_colorout ' , ' b_vscrt ' , ' b_ndebug ' ]