Skip to content

Commit cf41394

Browse files
committed
try using ToolHelper
1 parent 10a309d commit cf41394

File tree

1 file changed

+1
-41
lines changed

1 file changed

+1
-41
lines changed

src/fsharp/ReferenceResolution.fs

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,9 @@ module internal MSBuildResolver =
139139
/// The list of supported .NET Framework version numbers, using the monikers of the Reference Assemblies folder.
140140
let SupportedNetFrameworkVersions = set [ Net20; Net30; Net35; Net40; Net45; Net451; (*SL only*) "v5.0" ]
141141

142-
#if CROSS_PLATFORM_COMPILER
143-
// Mono doesn't have GetPathToDotNetFramework. In this case we simply don't search this extra directory.
144-
// When the x-plat compiler is run on Mono this is ok since implementation assembly folder is the same as the target framework folder.
145-
// When the x-plat compiler is run on Windows/.NET this will curently cause slightly divergent behaviour.
146-
let GetPathToDotNetFrameworkImlpementationAssemblies _v = []
147-
#else
148142
/// Get the path to the .NET Framework implementation assemblies by using ToolLocationHelper.GetPathToDotNetFramework.
149143
/// This is only used to specify the "last resort" path for assembly resolution.
150144
let GetPathToDotNetFrameworkImlpementationAssemblies(v) =
151-
#if FX_ATLEAST_45
152145
let v =
153146
match v with
154147
| Net11 -> Some TargetDotNetFrameworkVersion.Version11
@@ -165,30 +158,9 @@ module internal MSBuildResolver =
165158
| null -> []
166159
| x -> [x]
167160
| _ -> []
168-
#else
169-
// FX_ATLEAST_45 is not defined for step when we build compiler with proto compiler.
170-
ignore v
171-
[]
172-
#endif
173-
#endif
174-
175-
176-
#if CROSS_PLATFORM_COMPILER
177-
// ToolLocationHelper.GetPathToDotNetFrameworkReferenceAssemblies is not available on Mono.
178-
// We currently use the old values that the F# 2.0 compiler assumed.
179-
// When the x-plat compiler is run on Mono this is ok since the asemblies are all in the framework folder
180-
// When the x-plat compiler is run on Windows/.NET this will curently cause slightly divergent behaviour this directory
181-
// may not be the same as the Microsoft compiler in all cases.
182-
let GetPathToDotNetFrameworkReferenceAssembliesFor40Plus(version) =
183-
match version with
184-
| Net40 -> ReplaceVariablesForLegacyFxOnWindows([@"{ReferenceAssemblies}\v4.0"])
185-
| Net45 -> ReplaceVariablesForLegacyFxOnWindows([@"{ReferenceAssemblies}\v4.5"])
186-
| Net451 -> ReplaceVariablesForLegacyFxOnWindows([@"{ReferenceAssemblies}\v4.5"])
187-
| _ -> []
188-
#else
161+
189162

190163
let GetPathToDotNetFrameworkReferenceAssembliesFor40Plus(version) =
191-
#if FX_ATLEAST_45
192164
// starting with .Net 4.0, the runtime dirs (WindowsFramework) are never used by MSBuild RAR
193165
let v =
194166
match version with
@@ -202,24 +174,12 @@ module internal MSBuildResolver =
202174
| null -> []
203175
| x -> [x]
204176
| None -> []
205-
#else
206-
// FX_ATLEAST_45 is not defined for step when we build compiler with proto compiler.
207-
ignore version
208-
[]
209-
#endif
210-
#endif
211177

212-
#if CROSS_PLATFORM_COMPILER
213-
let HighestInstalledNetFrameworkVersionMajorMinor() =
214-
// Mono doesn't have GetPathToDotNetFramework
215-
4, Net40
216-
#else
217178
/// Use MSBuild to determine the version of the highest installed framework.
218179
let HighestInstalledNetFrameworkVersionMajorMinor() =
219180
if box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version451)) <> null then 4, Net451
220181
elif box (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version45)) <> null then 4, Net45
221182
else 4, Net40 // version is 4.0 assumed since this code is running.
222-
#endif
223183

224184
/// Derive the target framework directories.
225185
let DeriveTargetFrameworkDirectories (targetFrameworkVersion:string, logMessage) =

0 commit comments

Comments
 (0)