Fix linkage issue

Signed-off-by: Max Risuhin <risuhin.max@gmail.com>
This commit is contained in:
Max Risuhin 2018-11-19 13:59:25 +02:00
parent d9f61c48b0
commit 296155bf50
No known key found for this signature in database
GPG Key ID: BF733F5ACA0B4448
5 changed files with 29 additions and 4 deletions

View File

@ -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/parser"
"${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/src" "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/src"
"${CMAKE_CURRENT_SOURCE_DIR}/../../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" "${CMAKE_CURRENT_SOURCE_DIR}/../../src/object-store/build4/CMakeFiles/realm-core/src/realm-core/build.release/installed/include"
PARENT_SCOPE) 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)

View File

@ -2,6 +2,8 @@
#include "bridge.h" #include "bridge.h"
#include "eventdispatcher.h" #include "eventdispatcher.h"
#include "qwebengine_init.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QDebug> #include <QDebug>
#include <QUrl> #include <QUrl>
@ -27,7 +29,7 @@ void Realm::setBridge(Bridge *bridge) {
Q_D(Realm); Q_D(Realm);
d->bridge = bridge; d->bridge = bridge;
CustomWebPage::instance()->runJavaScript("console.log(\"Setting Realm\"); var Realm = {}; localStorage.clear();", 1); realm::qwebengine::qwebengine_init();
} }
QString Realm::moduleName() { return "Realm"; } QString Realm::moduleName() { return "Realm"; }

View File

@ -19,12 +19,14 @@
#include "qwebengine_init.hpp" #include "qwebengine_init.hpp"
#include "js_realm.hpp" #include "js_realm.hpp"
#include "bridge.h"
namespace realm { namespace realm {
namespace qwebengine { 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 } // realm

View File

@ -0,0 +1,15 @@
#ifndef _QWEBENGINE_INIT_H_
#define _QWEBENGINE_INIT_H_
#include <QVariant>
namespace realm {
namespace qwebengine {
void qwebengine_init();
} // qwebengine
} // realm
#endif

View File

@ -18,6 +18,7 @@
#pragma once #pragma once
#include "qwebengine_init.h"
#include "qwebengine_string.hpp" #include "qwebengine_string.hpp"
#include "qwebengine_protected.hpp" #include "qwebengine_protected.hpp"
#include "qwebengine_context.hpp" #include "qwebengine_context.hpp"