akihikodaki / cld3-ruby

cld3-ruby is an interface of Compact Language Detector v3 (CLD3) for Ruby.
Apache License 2.0
77 stars 22 forks source link

Optional Clang support #11

Closed vaygr closed 6 years ago

vaygr commented 7 years ago

Hi,

it'd be great to have Clang support here in order to be able to build cld3-ruby native extensions on systems with older GCC (like 4.6), but with Clang (e.g. 3.4) available.

For this, only g++ version just needs to be checked, and if it's <4.7, then fallback to clang++ if it's available. For this case extconf.rb can be edited to have CXX config value set conditionally:

RbConfig::MAKEFILE_CONFIG['CXX'] = "clang++"

I checked both 3.1.2 and 3.1.3 build just fine with Clang 3.4+.

Thanks in advance.

akihikodaki commented 7 years ago

You should build Ruby with clang if you want to use it to build this library. Please try that and see if it works.

akihikodaki commented 6 years ago

I'm closing this issue, marking invalid; it is expected to work with clang if Ruby is built with the same compiler. If not, please tell me and I'll remove invalid label.