-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fsc compilation fix #601
fsc compilation fix #601
Conversation
// But if it's not, then figure out what it should be. | ||
else | ||
let outExt = | ||
if Seq.exists (fun e -> e = "-a" || e = "--target:library") opts then ".dll" | ||
else ".exe" | ||
"-o" :: FileHelper.changeExt outExt (List.head srcFiles) :: opts @ srcFiles | ||
"fsc.exe" :: "-o" :: FileHelper.changeExt outExt (List.head srcFiles) :: opts @ srcFiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put it without duplication on the line where the Compile
get called?
I just moved the cons to the top. |
@@ -50,6 +50,8 @@ let fscList (srcFiles : string list) (opts : string list) : int = | |||
let scs = SimpleSourceCodeServices() | |||
|
|||
let optsArr = | |||
// Always prepend "fsc.exe" since fsc compiler skips the first argument | |||
"fsc.exe" :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to bother, I forgot to mention the other reason why it should be moved down.
optsArr
will be traced out, we don't need fsc.exe
in that trace message.
Okay that makes sense to me. |
thanks. |
Since Fsc always skips the first argument, it is important to use a dummy argument when calling a Compile function. Otherwise, following compiler options can be ignored. For example, the current version of FAKE always ignores Output parameter, because "-o" is the first argument that appears in optsArr (thus, it is ignored along with the second argument that specifies the output file name). For your reference, Fsc compiler test code also includes "fsc.exe" as the first argument when calling the Compile function.