From 87d75b0ca180ebc5fb497693170108df852009e3 Mon Sep 17 00:00:00 2001 From: Yavor Georgiev Date: Thu, 12 Oct 2017 15:47:46 +0200 Subject: [PATCH] Fix gyp mess This reverts commit ffb0f84361c8131e9ef0b55a70234dae1bdb5121. --- binding.gyp | 19 +++++---- binding.gypi | 106 --------------------------------------------------- package.json | 1 - realm.gypi | 83 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 114 deletions(-) delete mode 100644 binding.gypi diff --git a/binding.gyp b/binding.gyp index d68156b3..bac961b6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,25 +1,30 @@ { - "includes": [ - "binding.gypi" + "includes": [ + "target_defaults.gypi", + "realm.gypi" ], "targets": [ { "target_name": "realm", - "dependencies": [ "realm-js" ], - "include_dirs": [ - "src" + "dependencies": [ + "object-store" ], "sources": [ + "src/node/platform.cpp", + "src/js_realm.cpp", "src/node/node_init.cpp" + ], + "include_dirs": [ + "src" ] }, { "target_name": "action_after_build", "type": "none", - "dependencies": [ "realm" ], + "dependencies": [ "<(module_name)" ], "copies": [ { - "files": [ "<(PRODUCT_DIR)/realm.node" ], + "files": [ "<(PRODUCT_DIR)/<(module_name).node" ], "destination": "<(module_path)" } ] diff --git a/binding.gypi b/binding.gypi deleted file mode 100644 index eee23216..00000000 --- a/binding.gypi +++ /dev/null @@ -1,106 +0,0 @@ -{ - "includes": [ - "target_defaults.gypi", - "realm.gypi" - ], - "targets": [ - { - "target_name": "realm-js", - "dependencies": [ - "vendored-realm", "object-store" - ], - "sources": [ - "src/node/platform.cpp", - "src/js_realm.cpp" - ], - "include_dirs": [ - "src" - ], - "type": "static_library", - "export_dependent_settings": [ "object-store" ] - }, - { - "target_name": "object-store", - "dependencies": [ "realm-core" ], - "type": "static_library", - "include_dirs": [ - "src/object-store/src", - "src/object-store/external/pegtl" - ], - "defines": [ "REALM_PLATFORM_NODE=1" ], - "sources": [ - "src/object-store/src/binding_callback_thread_observer.cpp", - "src/object-store/src/collection_notifications.cpp", - "src/object-store/src/index_set.cpp", - "src/object-store/src/list.cpp", - "src/object-store/src/object.cpp", - "src/object-store/src/placeholder.cpp", - "src/object-store/src/object_schema.cpp", - "src/object-store/src/object_store.cpp", - "src/object-store/src/results.cpp", - "src/object-store/src/schema.cpp", - "src/object-store/src/shared_realm.cpp", - "src/object-store/src/thread_safe_reference.cpp", - "src/object-store/src/impl/collection_change_builder.cpp", - "src/object-store/src/impl/collection_notifier.cpp", - "src/object-store/src/impl/list_notifier.cpp", - "src/object-store/src/impl/object_notifier.cpp", - "src/object-store/src/impl/primitive_list_notifier.cpp", - "src/object-store/src/impl/realm_coordinator.cpp", - "src/object-store/src/impl/results_notifier.cpp", - "src/object-store/src/impl/transact_log_handler.cpp", - "src/object-store/src/impl/weak_realm_notifier.cpp", - "src/object-store/src/parser/parser.cpp", - "src/object-store/src/parser/query_builder.cpp", - "src/object-store/src/util/format.cpp", - "src/object-store/src/util/uuid.cpp" - ], - "conditions": [ - ["OS=='win'", { - "sources": [ - "src/object-store/src/impl/windows/external_commit_helper.cpp", - ] - }], - ["OS=='linux'", { - "sources": [ - "src/object-store/src/impl/epoll/external_commit_helper.cpp", - ] - }], - ["OS=='mac'", { - "sources": [ - "src/object-store/src/impl/apple/external_commit_helper.cpp", - "src/object-store/src/impl/apple/keychain_helper.cpp", - "src/object-store/src/sync/impl/apple/network_reachability_observer.cpp", - "src/object-store/src/sync/impl/apple/system_configuration.cpp" - ] - }], - ["realm_enable_sync", { - "dependencies": [ "realm-sync" ], - "sources": [ - "src/object-store/src/sync/partial_sync.cpp", - "src/object-store/src/sync/sync_config.cpp", - "src/object-store/src/sync/sync_manager.cpp", - "src/object-store/src/sync/sync_user.cpp", - "src/object-store/src/sync/sync_session.cpp", - "src/object-store/src/sync/sync_config.cpp", - "src/object-store/src/sync/impl/sync_file.cpp", - "src/object-store/src/sync/impl/sync_metadata.cpp" - ], - }] - ], - "all_dependent_settings": { - "defines": [ "REALM_PLATFORM_NODE=1" ], - "include_dirs": [ - "src/object-store/src", - "src/object-store/src/impl", - "src/object-store/src/impl/apple", - "src/object-store/src/parser", - "src/object-store/external/pegtl" - ] - }, - "export_dependent_settings": [ - "<@(_dependencies)" # re-export settings related to linking the realm binaries - ] - } - ] -} \ No newline at end of file diff --git a/package.json b/package.json index cd8efc4e..9d415702 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,6 @@ "tests", "vendor", "binding.gyp", - "binding.gypi", "realm.gypi", "target_defaults.gypi", "dependencies.list" diff --git a/realm.gypi b/realm.gypi index 000ae836..77cd8063 100644 --- a/realm.gypi +++ b/realm.gypi @@ -27,6 +27,89 @@ }] ], "targets": [ + { + "target_name": "object-store", + "dependencies": [ "realm-core" ], + "type": "static_library", + "include_dirs": [ + "src/object-store/src", + "src/object-store/external/pegtl" + ], + "defines": [ "REALM_PLATFORM_NODE=1" ], + "sources": [ + "src/object-store/src/binding_callback_thread_observer.cpp", + "src/object-store/src/collection_notifications.cpp", + "src/object-store/src/index_set.cpp", + "src/object-store/src/list.cpp", + "src/object-store/src/object.cpp", + "src/object-store/src/placeholder.cpp", + "src/object-store/src/object_schema.cpp", + "src/object-store/src/object_store.cpp", + "src/object-store/src/results.cpp", + "src/object-store/src/schema.cpp", + "src/object-store/src/shared_realm.cpp", + "src/object-store/src/thread_safe_reference.cpp", + "src/object-store/src/impl/collection_change_builder.cpp", + "src/object-store/src/impl/collection_notifier.cpp", + "src/object-store/src/impl/list_notifier.cpp", + "src/object-store/src/impl/object_notifier.cpp", + "src/object-store/src/impl/primitive_list_notifier.cpp", + "src/object-store/src/impl/realm_coordinator.cpp", + "src/object-store/src/impl/results_notifier.cpp", + "src/object-store/src/impl/transact_log_handler.cpp", + "src/object-store/src/impl/weak_realm_notifier.cpp", + "src/object-store/src/parser/parser.cpp", + "src/object-store/src/parser/query_builder.cpp", + "src/object-store/src/util/format.cpp", + "src/object-store/src/util/uuid.cpp", + ], + "conditions": [ + ["OS=='win'", { + "sources": [ + "src/object-store/src/impl/windows/external_commit_helper.cpp", + ] + }], + ["OS=='linux'", { + "sources": [ + "src/object-store/src/impl/epoll/external_commit_helper.cpp", + ] + }], + ["OS=='mac'", { + "sources": [ + "src/object-store/src/impl/apple/external_commit_helper.cpp", + "src/object-store/src/impl/apple/keychain_helper.cpp", + "src/object-store/src/sync/impl/apple/network_reachability_observer.cpp", + "src/object-store/src/sync/impl/apple/system_configuration.cpp" + ] + }], + ["realm_enable_sync", { + "dependencies": [ "realm-sync" ], + "sources": [ + "src/object-store/src/sync/partial_sync.cpp", + "src/object-store/src/sync/sync_config.cpp", + "src/object-store/src/sync/sync_manager.cpp", + "src/object-store/src/sync/sync_user.cpp", + "src/object-store/src/sync/sync_session.cpp", + "src/object-store/src/sync/sync_config.cpp", + "src/object-store/src/sync/impl/sync_file.cpp", + "src/object-store/src/sync/impl/sync_metadata.cpp" + ], + }] + ], + "all_dependent_settings": { + "defines": [ "REALM_PLATFORM_NODE=1" ], + "include_dirs": [ + "src/object-store/src", + "src/object-store/src/impl", + "src/object-store/src/impl/apple", + "src/object-store/src/parser", + "src/object-store/external/pegtl" + ] + }, + "export_dependent_settings": [ + "<@(_dependencies)" # re-export settings related to linking the realm binaries + ] + }, { "target_name": "realm-core", "type": "none",