Closed TeBoring closed 5 years ago
Usually you do this in extconf.rb like here and make it conditionally depending on on one the RCD environment variables.
But it should also work to properly set the CFLAGS
environment variable from the Rakefile.
I tried to set CFLAGS in extconf.rb, but didn't work. How to set it it Rakefile?
CFLAGS can be set in the Rakefile like so:
RakeCompilerDock.sh "bundle --local && rake cross native gem CFLAGS=-std=gnu11"
But if it doesn't work in extconf.rb per $CFLAGS, there's probably something other wrong.
Still doesn't work
Are you able to build an extension which uses strptime?
I am confused why our test doesn't have such a problem. However, the job to use docker to build ruby gem has such a problem.
Is that related to cross compiling?
Seems only fail with x86-mingw32.
ok, seems mingw doesn't have strptime.
MINGW has some small POSIX additions, but isn't really POSIX compliant. Makes sense!
Our code currently depend on strptime which is only provided by posix. How to use -std=gnu11 in Rakefile? Thanks!