提交 97904fc3 编写于 作者: K Kevin Ransom (msft) 提交者: GitHub

Merge pull request #1462 from KevinRansom/master

Fix fsharp.core.dll copies
......@@ -1810,23 +1810,25 @@ let copyFSharpCore(outFile: string, referencedDlls: AssemblyReference list) =
let outDir = Path.GetDirectoryName(outFile)
let fsharpCoreAssemblyName = GetFSharpCoreLibraryName() + ".dll"
let fsharpCoreDestinationPath = Path.Combine(outDir, fsharpCoreAssemblyName)
if not (File.Exists(fsharpCoreDestinationPath)) then
match referencedDlls |> Seq.tryFind (fun dll -> String.Equals(Path.GetFileName(dll.Text), fsharpCoreAssemblyName, StringComparison.CurrentCultureIgnoreCase)) with
| Some referencedFsharpCoreDll -> File.Copy(referencedFsharpCoreDll.Text, fsharpCoreDestinationPath)
| None ->
let executionLocation =
let copyFileIfDifferent src dest =
if not (File.Exists(dest)) || (File.GetCreationTimeUtc(src) <> File.GetCreationTimeUtc(dest)) then
File.Copy(src, dest, true)
match referencedDlls |> Seq.tryFind (fun dll -> String.Equals(Path.GetFileName(dll.Text), fsharpCoreAssemblyName, StringComparison.CurrentCultureIgnoreCase)) with
| Some referencedFsharpCoreDll -> copyFileIfDifferent referencedFsharpCoreDll.Text fsharpCoreDestinationPath
| None ->
let executionLocation =
#if FX_RESHAPED_REFLECTION
TypeInThisAssembly(null).GetType().GetTypeInfo().Assembly.Location
TypeInThisAssembly(null).GetType().GetTypeInfo().Assembly.Location
#else
Assembly.GetExecutingAssembly().Location
Assembly.GetExecutingAssembly().Location
#endif
let compilerLocation = Path.GetDirectoryName(executionLocation)
let compilerFsharpCoreDllPath = Path.Combine(compilerLocation, fsharpCoreAssemblyName)
if File.Exists(compilerFsharpCoreDllPath) then
File.Copy(compilerFsharpCoreDllPath, fsharpCoreDestinationPath)
else
errorR(Error(FSComp.SR.fsharpCoreNotFoundToBeCopied(), rangeCmdArgs))
let compilerLocation = Path.GetDirectoryName(executionLocation)
let compilerFsharpCoreDllPath = Path.Combine(compilerLocation, fsharpCoreAssemblyName)
if File.Exists(compilerFsharpCoreDllPath) then
copyFileIfDifferent compilerFsharpCoreDllPath fsharpCoreDestinationPath
else
errorR(Error(FSComp.SR.fsharpCoreNotFoundToBeCopied(), rangeCmdArgs))
//----------------------------------------------------------------------------
// main - split up to make sure that we can GC the
......@@ -2040,7 +2042,8 @@ let main4 (Args (tcConfig, errorLogger: ErrorLogger, ilGlobals, ilxMainModule, o
AbortOnError(errorLogger, tcConfig, exiter)
if tcConfig.copyFSharpCore then
// Don't copy referenced fharp.core.dll if we are building fsharp.core.dll
if tcConfig.copyFSharpCore && not tcConfig.compilingFslib then
copyFSharpCore(outfile, tcConfig.referencedDLLs)
SqmLoggerWithConfig tcConfig errorLogger.ErrorNumbers errorLogger.WarningNumbers
......
......@@ -26,6 +26,8 @@ if not "%WindowsSDK_ExecutablePath_x86%" == "" goto :havesdk
set REGEXE32BIT=reg.exe
if not "%OSARCH%"=="x86" set REGEXE32BIT=%WINDIR%\syswow64\reg.exe
FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6.2\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6.1\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\NETFXSDK\4.6\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
if "%WINSDKNETFXTOOLS_x86%"=="" FOR /F "tokens=2* delims= " %%A IN ('%REGEXE32BIT% QUERY "HKLM\Software\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools" /v InstallationFolder') DO SET WINSDKNETFXTOOLS_x86=%%B
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册