-
Notifications
You must be signed in to change notification settings - Fork 8
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
Don't assume gcc. #13
Conversation
eh, it didn't expect gcc in the first place, while it now only adds the flags for gcc (and not clang and everything else). Is Visual Studio so braindead that it doesn't support unless RbConfig::CONFIG['cc'] == 'visual-studio-something'
end |
I'm not sure I follow. With my patch it only adds the flags if gcc. Visual Studio actually does support -Wall, but really you want -W3. However, the ruby-core team specifically overrides anything above -W2 (since Ruby 2.0 I think), so it wouldn't do any good anyway. |
The actual problem was the -Wextra switch, which isn't supported by Visual Studio. I doubt other compilers support it, either. |
That's exactly the problem, it only adds the flags when gcc is used. While I'm not sure if MRI can be compiled with clang these days you can compile Rubinius with it (it's actually recommended and my current default compiler for it).
clang and gcc support it just fine. If this is the only option not supported by visual studio it can be skipped in case of VS, but simply not adding any flags is a bit too much if you'd ask me. |
Put it this way:
|
It supports -Wall but not -Wpedantic. By other compilers, I meant the Sun Studio compiler and the HP-UX compiler. I don't know if those options are supported for those compilers. RbConfig::CONFIG['GCC'] returns nil for a Ruby compiled with Visual Studio and "yes" for the one-click installer. |
Errr woops, I meant |
RbConfig::CONFIG['CC'] # => "cl -nologo" "cl" is the command line compiler name. The -nologo thing is just to make it shut up about copyright. BTW, the analogue to -g for VS is "-Z7" for debugging symbols in an .obj file. Or you can use "-Zi" and it will generate a .pdb file instead. It looks like -Od is the equivalent of -O0. |
Moving this over to #14. I'll look into adjusting the extconf.rb as well. |
Ok, thanks. BTW, I think you want 'CC', not 'cc'. |
@djberg96 Gah, you're right. |
This lets things work with Visual Studio, the Sun Studio compiler and so on. :)