I'm writing a Ruby extension, for which I have a standard mkmf configuration script, but I need to add a special include flag (--std=c++0x
) to all of the C++ compilation steps. I don't want it in the C compilation steps, 'cause it throws warnings. How should I do this?
require 'mkmf'
create_makefile('thing')
For instance, I tried $CXXFLAGS << '-I..'
, but CXXFLAGS isn't defined, yet. If I use $CXXFLAGS = '-I..'
, it's just overwritten later.
This works for me.
$CXXFLAGS += " -std=c++11 "
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With