diff --git a/react-native/desktop/CMakeLists.txt b/react-native/desktop/CMakeLists.txt index 76905ab8..82dcd13d 100755 --- a/react-native/desktop/CMakeLists.txt +++ b/react-native/desktop/CMakeLists.txt @@ -44,6 +44,11 @@ set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_INCLUDE_DIRS ${REACT_NATIVE_DESKTOP_EX "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/src/parser" "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/src" "${CMAKE_CURRENT_SOURCE_DIR}/../../src" + "${CMAKE_CURRENT_SOURCE_DIR}/../../src/qwebengine" "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/build4/CMakeFiles/realm-core/src/realm-core/build.release/installed/include" PARENT_SCOPE) +set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_LIBS ${REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_LIBS} + "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/build4/CMakeFiles/realm-core/src/realm-core/build.release/installed/lib/librealm.a" + libcrypto.a PARENT_SCOPE) + diff --git a/react-native/desktop/realm.cpp b/react-native/desktop/realm.cpp index 2f325b15..0d9aa035 100644 --- a/react-native/desktop/realm.cpp +++ b/react-native/desktop/realm.cpp @@ -2,6 +2,8 @@ #include "bridge.h" #include "eventdispatcher.h" +#include "qwebengine_init.h" + #include #include #include @@ -27,7 +29,7 @@ void Realm::setBridge(Bridge *bridge) { Q_D(Realm); d->bridge = bridge; - CustomWebPage::instance()->runJavaScript("console.log(\"Setting Realm\"); var Realm = {}; localStorage.clear();", 1); + realm::qwebengine::qwebengine_init(); } QString Realm::moduleName() { return "Realm"; } diff --git a/src/qwebengine/qwebengine_init.cpp b/src/qwebengine/qwebengine_init.cpp index 16f7c9c4..0e1ec790 100644 --- a/src/qwebengine/qwebengine_init.cpp +++ b/src/qwebengine/qwebengine_init.cpp @@ -19,12 +19,14 @@ #include "qwebengine_init.hpp" #include "js_realm.hpp" +#include "bridge.h" + namespace realm { namespace qwebengine { -static void init(QVariant exports) { - +void qwebengine_init() { + CustomWebPage::instance()->runJavaScript("console.log(\"Setting Realm\"); var Realm = {}; localStorage.clear();", 1); } -} // node +} // qwebengine } // realm diff --git a/src/qwebengine/qwebengine_init.h b/src/qwebengine/qwebengine_init.h new file mode 100644 index 00000000..64bc3418 --- /dev/null +++ b/src/qwebengine/qwebengine_init.h @@ -0,0 +1,15 @@ +#ifndef _QWEBENGINE_INIT_H_ +#define _QWEBENGINE_INIT_H_ + + +#include + +namespace realm { +namespace qwebengine { + +void qwebengine_init(); + +} // qwebengine +} // realm + +#endif diff --git a/src/qwebengine/qwebengine_init.hpp b/src/qwebengine/qwebengine_init.hpp index e8fe3f38..c3ffc2b5 100644 --- a/src/qwebengine/qwebengine_init.hpp +++ b/src/qwebengine/qwebengine_init.hpp @@ -18,6 +18,7 @@ #pragma once +#include "qwebengine_init.h" #include "qwebengine_string.hpp" #include "qwebengine_protected.hpp" #include "qwebengine_context.hpp"