diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py index 8308fa84..1a1bfa32 100644 --- a/pylib/gyp/generator/msvs.py +++ b/pylib/gyp/generator/msvs.py @@ -3440,6 +3440,24 @@ def _FinalizeMSBuildSettings(spec, configuration): def _GetValueFormattedForMSBuild(tool_name, name, value): + """ + >>> _GetValueFormattedForMSBuild( + ... tool_name="tool_name", name="name", value=[] + ... ) + '' + >>> _GetValueFormattedForMSBuild( + ... tool_name="tool_name", name="name", value=["DelayLoadDLLs"] + ... ) + 'DelayLoadDLLs' + >>> _GetValueFormattedForMSBuild( + ... tool_name="Lib", name="AdditionalOptions", value=["DelayLoadDLLs"] + ... ) + 'DelayLoadDLLs %(AdditionalOptions)' + >>> _GetValueFormattedForMSBuild( + ... tool_name="ClCompile", name="AdditionalOptions", value=["DelayLoadDLLs"] + ... ) + 'DelayLoadDLLs %(AdditionalOptions)' + """ if type(value) == list: # For some settings, VS2010 does not automatically extends the settings # TODO(jeanluc) Is this what we want? @@ -3466,6 +3484,8 @@ def _GetValueFormattedForMSBuild(tool_name, name, value): formatted_value = char.join( [MSVSSettings.ConvertVCMacrosToMSBuild(i) for i in value] ) + if tool_name == "ClCompile" and name == "AdditionalOptions": + formatted_value += os.environ.get("CL", "").replace("#", "=") else: formatted_value = MSVSSettings.ConvertVCMacrosToMSBuild(value) return formatted_value diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py index 5b9c2712..a9eff534 100644 --- a/pylib/gyp/msvs_emulation.py +++ b/pylib/gyp/msvs_emulation.py @@ -1125,6 +1125,7 @@ def _ExtractImportantEnvironment(output_of_set): "systemroot", "temp", "tmp", + "cl", ) env = {} # This occasionally happens and leads to misleading SYSTEMROOT error messages