Method: #gplusplus_version
- Defined in:
- ext/nmatrix/extconf.rb
#gplusplus_version ⇒ Object
122 123 124 125 126 127 128 129 130 131 |
# File 'ext/nmatrix/extconf.rb', line 122 def gplusplus_version cxxvar = proc { |n| `#{CONFIG['CXX']} -E -dM - </dev/null | grep #{n}`.chomp.split(' ')[2] } major = cxxvar.call('__GNUC__') minor = cxxvar.call('__GNUC_MINOR__') patch = cxxvar.call('__GNUC_PATCHLEVEL__') raise("unable to determine g++ version (match to get version was nil)") if major.nil? || minor.nil? || patch.nil? "#{major}.#{minor}.#{patch}" end |