prepare for the glorious future

This commit is contained in:
Yavor Georgiev 2016-10-08 19:36:03 +02:00
parent 857369f5a4
commit 5623653477
7 changed files with 11 additions and 79 deletions

View File

@ -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" ]
}
},
{

View File

@ -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",

View File

@ -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/

View File

@ -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<set_sync_logger>},
#endif
};
PropertyMap<T> const static_properties {
{"isDeveloperEdition", {wrap<get_is_developer_edition>, nullptr}}
};
};
template<typename T>
@ -137,10 +129,6 @@ inline typename T::Function SyncClass<T>::create_constructor(ContextType ctx) {
});
#endif
#if REALM_ENTERPRISE_EDITION
SyncEnterpriseClass<T>::add_methods(ctx, sync_constructor);
#endif
return sync_constructor;
}
@ -165,7 +153,7 @@ void SyncClass<T>::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<typename T>
void SyncClass<T>::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<T>::populate_sync_config(ContextType ctx, ObjectType config_objec
}
}
template<typename T>
void SyncClass<T>::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

View File

@ -1,21 +1,8 @@
{
"variables": {
"use_realm_debug": "<!(echo $REALMJS_USE_DEBUG_CORE)",
},
"targets": [
{
"target_name": "realm-core",
"type": "none",
"direct_dependent_settings": {
"conditions": [
["use_realm_debug!=''", {
"libraries": [ "-lrealm-node-dbg" ],
"defines": [ "REALM_DEBUG=1" ]
}, {
"libraries": [ "-lrealm-node" ]
}]
]
},
"all_dependent_settings": {
"defines": [ "REALM_HAVE_CONFIG", "REALM_PLATFORM_NODE=1", "REALM_ENABLE_SYNC" ]
},
@ -30,12 +17,6 @@
"direct_dependent_settings": {
"library_dirs": [ "<(prefix)/src/realm" ]
}
}, {
"conditions": [
["OS=='mac'", {
"dependencies": [ "vendored-realm" ]
}]
]
}]
]
},
@ -43,15 +24,6 @@
"target_name": "realm-sync",
"type": "none",
"dependencies": [ "realm-core" ], # sync headers include core headers
"direct_dependent_settings": {
"conditions": [
["use_realm_debug!=''", {
"libraries": [ "-lrealm-sync-node-dbg" ]
}, {
"libraries": [ "-lrealm-sync-node" ]
}]
]
},
"export_dependent_settings": [ "realm-core" ], # depending on sync is tantamount to depending on core
"variables": {
"prefix": "<!(echo $REALM_SYNC_PREFIX)"
@ -64,26 +36,8 @@
"direct_dependent_settings": {
"library_dirs": [ "<(prefix)/src/realm" ]
}
},
{
"conditions": [
["OS=='mac'", {
"dependencies": [ "vendored-realm" ]
}]
]
}]
],
},
{
"variables": {
"realm_vendor_dir%": "<(module_root_dir)/vendor",
},
"target_name": "vendored-realm",
"type": "none",
"all_dependent_settings": {
"include_dirs": [ "<(realm_vendor_dir)/realm-sync/include" ],
"library_dirs": [ "<(realm_vendor_dir)/realm-sync/osx" ]
}
}
]
}

View File

@ -3,7 +3,9 @@
"variables": {
"warning-flags": [
"-Wno-missing-field-initializers",
"-Wno-return-type"
"-Wno-return-type",
"-Wno-unused-result",
"-Wundef"
]
},
"cflags_cc!": [ # turn off default flags on older nodes on linux

View File

@ -23,7 +23,10 @@
#include <map>
#include <string>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"
#include <nan.h>
#pragma GCC diagnostic pop
#include "js_types.hpp"