From 562365347743e3726a72b9d46e435d99f04d011d Mon Sep 17 00:00:00 2001 From: Yavor Georgiev Date: Sat, 8 Oct 2016 19:36:03 +0200 Subject: [PATCH] prepare for the glorious future --- binding.gyp | 8 ++---- package.json | 2 +- scripts/build-node-pre-gyp.sh | 4 +-- src/js_sync.hpp | 23 +--------------- src/node/gyp/realm.gyp | 46 ------------------------------- src/node/gyp/target_defaults.gypi | 4 ++- src/node/node_types.hpp | 3 ++ 7 files changed, 11 insertions(+), 79 deletions(-) diff --git a/binding.gyp b/binding.gyp index 9570c888..ae4a3510 100644 --- a/binding.gyp +++ b/binding.gyp @@ -5,9 +5,6 @@ ], "targets": [ { - "variables": { - "developer_edition%": "0" - }, "target_name": "realm", "dependencies": [ "object-store" @@ -21,14 +18,13 @@ "include_dirs": [ "src" ], - "defines": [ "REALM_DEVELOPER_EDITION=<(developer_edition)" ], "link_settings": { "ldflags": [ - "-Wl,--exclude-libs=ALL" + "-Wl,--whole-archive,-lrealm-node,--no-whole-archive" ] }, "xcode_settings": { - "OTHER_LDFLAGS": [ "-Xlinker -unexported_symbol -Xlinker '*'" ] + "OTHER_LDFLAGS": [ "-all_load", "-lrealm-node" ] } }, { diff --git a/package.json b/package.json index 4cc27420..4a2de659 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "jsdoc": "rm -rf docs/output && jsdoc -c docs/conf.json", "lint": "eslint", "test": "scripts/test.sh", - "install": "node-pre-gyp install --build-from-source" + "install": "node-pre-gyp install --fallback-to-build" }, "dependencies": { "nan": "^2.3.3", diff --git a/scripts/build-node-pre-gyp.sh b/scripts/build-node-pre-gyp.sh index 569f2acb..ba0998b7 100755 --- a/scripts/build-node-pre-gyp.sh +++ b/scripts/build-node-pre-gyp.sh @@ -9,8 +9,6 @@ die() { exit 1 } -. ${topdir}/dependencies.list - mkdir -p ${topdir}/out : ${NVM_DIR=$topdir/.nvm} @@ -37,7 +35,7 @@ for node_version in ${node_versions}; do nvm install ${node_version} || die "Could not install nodejs v${node_version}" nvm use ${node_version} || die "Could not load nodejs v${node_version}" - npm install "$EXTRA_NPM_ARGUMENTS" || die "Could not build module" + npm install --build-from-source "$EXTRA_NPM_ARGUMENTS" || die "Could not build module" #./scripts/test.sh node || die "Unit tests for nodejs v${node_version} failed" ./node_modules/.bin/node-pre-gyp package || die "Could not package module" cp build/stage/node-pre-gyp/*.tar.gz ${topdir}/out/ diff --git a/src/js_sync.hpp b/src/js_sync.hpp index 40739a57..d859b783 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -34,10 +34,6 @@ #include "node/node_sync_logger.hpp" #endif -#if REALM_ENTERPRISE_EDITION -#include "js_enterprise.hpp" -#endif - namespace realm { namespace js { @@ -82,10 +78,6 @@ public: {"setSyncLogger", wrap}, #endif }; - - PropertyMap const static_properties { - {"isDeveloperEdition", {wrap, nullptr}} - }; }; template @@ -137,10 +129,6 @@ inline typename T::Function SyncClass::create_constructor(ContextType ctx) { }); #endif -#if REALM_ENTERPRISE_EDITION - SyncEnterpriseClass::add_methods(ctx, sync_constructor); -#endif - return sync_constructor; } @@ -165,7 +153,7 @@ void SyncClass::set_verify_servers_ssl_certificate(ContextType ctx, ObjectTyp realm::SyncManager::shared().set_client_should_validate_ssl(verify_servers_ssl_certificate); } -#if REALM_HAVE_NODE_SYNC_LOGGER +#if REALM_PLATFORM_NODE template void SyncClass::set_sync_logger(ContextType ctx, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) { validate_argument_count(argc, 1); @@ -213,14 +201,5 @@ void SyncClass::populate_sync_config(ContextType ctx, ObjectType config_objec } } -template -void SyncClass::get_is_developer_edition(ContextType ctx, ObjectType object, ReturnValue &return_value) { -#if REALM_ENTERPRISE_EDITION - return_value.set(false); -#else - return_value.set(true); -#endif -} - } // js } // realm diff --git a/src/node/gyp/realm.gyp b/src/node/gyp/realm.gyp index 09b57ca9..2f48ba83 100644 --- a/src/node/gyp/realm.gyp +++ b/src/node/gyp/realm.gyp @@ -1,21 +1,8 @@ { - "variables": { - "use_realm_debug": " #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wundef" #include +#pragma GCC diagnostic pop #include "js_types.hpp"