tags:

views:

35

answers:

1

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.

A: 

I've seen similar situations handled by defining $(CXX) to be a combination of the compiler and the desired argument.

CXX=gcc --std=c++0x
torak