nbind icon indicating copy to clipboard operation
nbind copied to clipboard

Compiling w/ C++14 or higher

Open arcanis opened this issue 8 years ago • 2 comments

Because nbind.gypi contains a bunch of various flags (such as -std=c++11), setting our own flags is actually a bit painful: one has to create another gypi file, include it after auto.gypi, and add a truthy condition inside (such as 1==1).

Is it really nbind's task to set the standard and optimization flags ? Shouldn't setting these flags be left to the user ? Or at least hidden behind a node-gyp variable ?

arcanis avatar Dec 17 '16 13:12 arcanis

You're right. This is also related to issue #32. The default flags need to be provided somewhere to make usage easier, but there's three options for handling this better:

  • Add a new node-gyp variable that disables the default flags, so you can define your own more easily.
  • Add several variables for setting individual things like RTTI support and C++ standard version. A bit complicated to maintain.
  • Tweak integration with autogypi so its --init-gyp command adds the flags to the new project's binding.gyp, so they can be removed from the main nbind.gypi.

jjrv avatar Dec 18 '16 22:12 jjrv

How is this going?
I'm currently having issue with RTTI with msvc. Nothing I can do to override RunTimeTypeInfo option. I can manually edit nbind.gypi, change RunTimeTypeInfo to true and compiling alright.
Because I intend to publish my package, do I need to write a script to automatically do that before every install routine (configure && build) or will you guys have a solution for this problem later?

khanhas avatar May 29 '18 03:05 khanhas