mattn / mruby-onig-regexp

mrbgem of 鬼雲's Regular Expression
30 stars 34 forks source link

build with bundled onigmo fails when c++ API is enabled #69

Open lutter opened 7 years ago

lutter commented 7 years ago

When I put conf.enable_cxx_api into my build_config.rb, building mruby-onig-regexp fails because it tries to build onigmo with a C++ compiler, but onigmo can not be built with a C++ compiler (e.g., it uses not as a field name in a struct, but that is a keyword in C++).

I see two ways to fix this: (1) build this mrbgem with CC even if the C++ API is enabled or (2) try to change Onigmo to build with a C++ compiler.

mattn commented 7 years ago

@take-cheeze do you have any idea?

take-cheeze commented 7 years ago

Use enable_cxx_exception instead. ( https://github.com/mruby/mruby/blob/0bcf9e28fc6b41f75e78557295decfdcdb947b7a/doc/guides/compile.md#c-abi ) Somehow the Shopify wants to compile C code with C++ compiler when enable_cxx_abi is enabled.

lutter commented 7 years ago

Thanks for the quick reply ! Unfortunately, I do need to build mruby with a C++ compiler, as my project needs to both call into mruby from C++, and call into C++ code from mruby.

If there's no easy solution on this end, I might try and set things up with a discrete onigmo build before I build mruby.