-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix C runtime windows build #786
Conversation
94a23f6
to
6c70220
Compare
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.
🎉
runtimes/c/discover.ml
Outdated
build system handle it properly. *) | ||
Config.c_compiler | ||
|> replace_string (compile (str "gcc")) ~by:"ar" | ||
|> print_string |
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 it not happen (on mac ?) that this is cc
or clang
? In this case this would call cc instead of ar
; maybe check if Config.c_compiler
ends with gcc
and then only replace, otherwise returning ar
?
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.
Oh you're absolutely right.
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.
I made sure that we were on windows and improved the regex a little. It seems to work as intended on both mac & windows.
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.
Nice! ar
never needs .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.
Windows automatically create ".exe"-less aliases for .exe binaries so it's safe to call it without the extension.
59485a5
to
097d38d
Compare
097d38d
to
b7a75c9
Compare
This PR fixes the build on windows which failed due to an invocation to
ar
which wasn't named this way on windows.It also fixes an issue introduced in #784 which made the failing build fails even more because windows's equivalent to pkg-config doesn't consider the cygwin folder.