@@ -3440,6 +3440,25 @@ def _FinalizeMSBuildSettings(spec, configuration):
34403440
34413441
34423442def _GetValueFormattedForMSBuild (tool_name , name , value ):
3443+ """
3444+ >>> PRODUCT_DIR_ABS = "PRODUCT_DIR_ABS"
3445+ >>> _GetValueFormattedForMSBuild(
3446+ ... tool_name="tool_name", name="name", value=[]
3447+ ... )
3448+ ''
3449+ >>> _GetValueFormattedForMSBuild(
3450+ ... tool_name="tool_name", name="name", value=["DelayLoadDLLs"]
3451+ ... )
3452+ 'DelayLoadDLLs'
3453+ >>> _GetValueFormattedForMSBuild(
3454+ ... tool_name="Lib", name="AdditionalOptions", value=["DelayLoadDLLs"]
3455+ ... )
3456+ 'DelayLoadDLLs %(AdditionalOptions)'
3457+ >>> _GetValueFormattedForMSBuild(
3458+ ... tool_name="ClCompile", name="AdditionalOptions", value=["DelayLoadDLLs"]
3459+ ... )
3460+ 'DelayLoadDLLs %(AdditionalOptions)'
3461+ """
34433462 if type (value ) == list :
34443463 # For some settings, VS2010 does not automatically extends the settings
34453464 # TODO(jeanluc) Is this what we want?
@@ -3466,6 +3485,8 @@ def _GetValueFormattedForMSBuild(tool_name, name, value):
34663485 formatted_value = char .join (
34673486 [MSVSSettings .ConvertVCMacrosToMSBuild (i ) for i in value ]
34683487 )
3488+ if tool_name == "ClCompile" and name == "AdditionalOptions" :
3489+ formatted_value += os .environ .get ("CL" , "" ).replace ("#" , "=" )
34693490 else :
34703491 formatted_value = MSVSSettings .ConvertVCMacrosToMSBuild (value )
34713492 return formatted_value
0 commit comments