nodejs-mobile / nodejs-mobile-module-compat

Repo to open issues, discuss and share workarounds about node modules compatibility with nodejs-mobile
0 stars 0 forks source link

pkcs11js - build workaround #4

Open Vanclief opened 6 years ago

Vanclief commented 6 years ago

pkcs11js

iOS The package has multiple throw exceptions, so for now the only available option is to allow CPP_EXCEPTIONS in the common.gypi

This is the line you should change: 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fno-exceptions

Android

The package was not linking successfuly when paired with grpc. I needed to add a -fPIC flag in the cflags for common.gypi. Added 'cflags': [ '-O3', '-fPIC'] in line 173.

jaimecbernardo commented 6 years ago

Thank you for sharing this workaround. Another way of doing this would be to create a section for 'OS=="ios"' similar to the one for 'OS=="mac"' in pkcs11js's binding.gyp file: https://github.com/PeculiarVentures/pkcs11js/blob/f6f46336994f3b7cc04a9714717bc9ba32ee0c4f/binding.gyp#L32-L43

Vanclief commented 6 years ago

Updated thread, I created a PR for this repo with my workaround for Android: https://github.com/janeasystems/nodejs-mobile/pull/137

jaimecbernardo commented 5 years ago

For this issue, a change to add -fPIC was added to nodejs-mobile-gyp: https://github.com/janeasystems/nodejs-mobile-gyp/commit/fa19d39733f08cf121479de8a0a6985ebc815e8a

This change was included with nodejs-mobile-gyp version 0.2.1