dll pack & replace mt

This commit is contained in:
王劲鹏 2021-05-18 16:15:28 +08:00 committed by osborn
parent e82e598921
commit ada65c836f
44 changed files with 137 additions and 60 deletions

View File

@ -28,26 +28,14 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
win32:CONFIG(debug, debug|release): {
QMAKE_CFLAGS_DEBUG += -MTd
QMAKE_CXXFLAGS_DEBUG += -MTd
LIBS += -lwinmm
LIBS += -lAdvapi32
LIBS += -lDbghelp
LIBS += -L$$PWD/../../v8/v8/win32/debug/
LIBS += -lv8_monolith
}
else:win32:CONFIG(release, debug|release): {
QMAKE_CFLAGS_RELEASE += -MT
QMAKE_CXXFLAGS_RELEASE += -MT
LIBS += -lwinmm
LIBS += -lAdvapi32
LIBS += -lDbghelp
LIBS += -L$$PWD/../../v8/v8/win32/release/
LIBS += -lv8_monolith
}
else:unix: {
LIBS += -L$$PWD/../../v8/v8/darwin/release/

View File

@ -4,12 +4,14 @@
#include <QQmlEngine>
#include <QVariant>
#include "DoricExport.h"
#include "DoricInterfaceDriver.h"
class DoricViewNode;
class DoricRootNode;
class DoricContext {
class DORIC_EXPORT DoricContext {
private:
QString mContextId;
QMap<QString, QObject *> mPluginMap;

View File

@ -3,9 +3,11 @@
#include <QDebug>
#include "DoricExport.h"
#include "DoricContext.h"
class DoricContextManager {
class DORIC_EXPORT DoricContextManager {
private:
static DoricContextManager *local_instance;
DoricContextManager() {}

View File

@ -0,0 +1,10 @@
#ifndef DORICEXPORT_H
#define DORICEXPORT_H
#if defined(DORIC_LIBRARY)
# define DORIC_EXPORT Q_DECL_EXPORT
#else
# define DORIC_EXPORT Q_DECL_IMPORT
#endif
#endif // DORICEXPORT_H

View File

@ -3,10 +3,12 @@
#include <QDebug>
#include "DoricExport.h"
#include "DoricInterfaceDriver.h"
#include "engine/DoricJSEngine.h"
class DoricNativeDriver : public DoricInterfaceDriver {
class DORIC_EXPORT DoricNativeDriver : public DoricInterfaceDriver {
private:
static DoricNativeDriver *local_instance;
DoricNativeDriver() {}

View File

@ -3,9 +3,11 @@
#include <QQuickItem>
#include "DoricExport.h"
#include "DoricContext.h"
class DoricPanel {
class DORIC_EXPORT DoricPanel {
private:
DoricContext *mContext;
int renderedWidth = -1;

View File

@ -4,11 +4,13 @@
#include <QDebug>
#include <QString>
#include "DoricExport.h"
#include "utils/DoricObjectFactory.h"
class DoricLibrary;
class DoricRegistry {
class DORIC_EXPORT DoricRegistry {
private:
static DoricRegistry *local_instance;

View File

@ -3,12 +3,14 @@
#include <QJSValue>
#include "DoricExport.h"
#include "DoricCallback.h"
#include "DoricSettableFuture.h"
static QJSValue EMPTY(QJSValue::NullValue);
class DoricAsyncResult {
class DORIC_EXPORT DoricAsyncResult {
private:
QJSValue result = EMPTY;
DoricCallback *callback;

View File

@ -3,9 +3,11 @@
#include <QJSValue>
#include "DoricExport.h"
#include "utils/DoricCountDownLatch.h"
class DoricSettableFuture {
class DORIC_EXPORT DoricSettableFuture {
private:
QJSValue mResult;
DoricCountDownLatch *mReadyLatch = new DoricCountDownLatch();

View File

@ -4,14 +4,13 @@ CONFIG += c++14
TARGET = DoricCore
TEMPLATE = lib
CONFIG += staticlib
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += V8_COMPRESS_POINTERS
DEFINES += DORIC_LIBRARY
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
@ -92,6 +91,7 @@ HEADERS += \
Doric.h \
DoricContext.h \
DoricContextManager.h \
DoricExport.h \
DoricInterfaceDriver.h \
DoricLibrary.h \
DoricNativeDriver.h \

View File

@ -4,7 +4,9 @@
#include <QJSValue>
#include <QObject>
class DoricBridgeExtension : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricBridgeExtension : public QObject {
Q_OBJECT
public:
explicit DoricBridgeExtension(QObject *parent = nullptr);

View File

@ -4,10 +4,12 @@
#include <QJSValue>
#include <QThreadPool>
#include "DoricExport.h"
#include "../DoricRegistry.h"
#include "DoricInterfaceJSE.h"
class DoricJSEngine : public QObject {
class DORIC_EXPORT DoricJSEngine : public QObject {
Q_OBJECT
private:
DoricInterfaceJSE *mJSE;

View File

@ -3,7 +3,9 @@
#include <QObject>
class DoricNativeEmpty : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricNativeEmpty : public QObject {
Q_OBJECT
public:

View File

@ -1,13 +1,15 @@
#ifndef NATIVE_JSE_H
#define NATIVE_JSE_H
#include "DoricExport.h"
#include "DoricInterfaceJSE.h"
#include "native/NativeExecutor.h"
#include "v8/V8Executor.h"
enum class JSEType { V8, Native };
class DoricNativeJSE : public DoricInterfaceJSE {
class DORIC_EXPORT DoricNativeJSE : public DoricInterfaceJSE {
private:
JSEType mType;

View File

@ -3,7 +3,9 @@
#include <QObject>
class DoricNativeLog : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricNativeLog : public QObject {
Q_OBJECT
public:

View File

@ -3,7 +3,9 @@
#include <QObject>
class DoricNativeRequire : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricNativeRequire : public QObject {
Q_OBJECT
public:

View File

@ -4,7 +4,9 @@
#include <QObject>
#include <QSet>
class DoricTimerExtension : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricTimerExtension : public QObject {
Q_OBJECT
private:

View File

@ -1,9 +1,11 @@
#ifndef DORICMODALPLUGIN_H
#define DORICMODALPLUGIN_H
#include "DoricExport.h"
#include "DoricNativePlugin.h"
class DoricModalPlugin : public DoricNativePlugin {
class DORIC_EXPORT DoricModalPlugin : public DoricNativePlugin {
Q_OBJECT
public:
using DoricNativePlugin::DoricNativePlugin;

View File

@ -1,9 +1,11 @@
#ifndef DORICNETWORKPLUGIN_H
#define DORICNETWORKPLUGIN_H
#include "DoricExport.h"
#include "DoricNativePlugin.h"
class DoricNetworkPlugin : public DoricNativePlugin {
class DORIC_EXPORT DoricNetworkPlugin : public DoricNativePlugin {
Q_OBJECT
public:
using DoricNativePlugin::DoricNativePlugin;

View File

@ -1,13 +1,15 @@
#ifndef DORICPOPOVERPLUGIN_H
#define DORICPOPOVERPLUGIN_H
#include "DoricNativePlugin.h"
#include <QQuickItem>
#include "DoricExport.h"
#include "DoricNativePlugin.h"
static QString TYPE = "popover";
class DoricPopoverPlugin : public DoricNativePlugin {
class DORIC_EXPORT DoricPopoverPlugin : public DoricNativePlugin {
Q_OBJECT
public:
using DoricNativePlugin::DoricNativePlugin;

View File

@ -1,9 +1,11 @@
#ifndef SHADERPLUGIN_H
#define SHADERPLUGIN_H
#include "DoricExport.h"
#include "DoricNativePlugin.h"
class DoricShaderPlugin : public DoricNativePlugin {
class DORIC_EXPORT DoricShaderPlugin : public DoricNativePlugin {
Q_OBJECT
public:
using DoricNativePlugin::DoricNativePlugin;

View File

@ -1,9 +1,11 @@
#ifndef DORICSTORAGEPLUGIN_H
#define DORICSTORAGEPLUGIN_H
#include "DoricExport.h"
#include "DoricNativePlugin.h"
class DoricStoragePlugin : public DoricNativePlugin {
class DORIC_EXPORT DoricStoragePlugin : public DoricNativePlugin {
Q_OBJECT
private:
static const QString PREF_NAME;

View File

@ -1,9 +1,11 @@
#ifndef DORICGROUPNODE_H
#define DORICGROUPNODE_H
#include "DoricExport.h"
#include "DoricSuperNode.h"
class DoricGroupNode : public DoricSuperNode {
class DORIC_EXPORT DoricGroupNode : public DoricSuperNode {
public:
using DoricSuperNode::DoricSuperNode;

View File

@ -1,10 +1,11 @@
#ifndef DORICHLAYOUTNODE_H
#define DORICHLAYOUTNODE_H
#include "DoricExport.h"
#include "DoricGroupNode.h"
class DoricHLayoutNode : public DoricGroupNode {
class DORIC_EXPORT DoricHLayoutNode : public DoricGroupNode {
public:
using DoricGroupNode::DoricGroupNode;

View File

@ -1,9 +1,11 @@
#ifndef DORICIMAGENODE_H
#define DORICIMAGENODE_H
#include "DoricExport.h"
#include "DoricViewNode.h"
class DoricImageNode : public DoricViewNode {
class DORIC_EXPORT DoricImageNode : public DoricViewNode {
public:
using DoricViewNode::DoricViewNode;

View File

@ -3,9 +3,11 @@
#include <QQuickItem>
#include "DoricExport.h"
#include "DoricStackNode.h"
class DoricRootNode : public DoricStackNode {
class DORIC_EXPORT DoricRootNode : public DoricStackNode {
public:
using DoricStackNode::DoricStackNode;

View File

@ -1,9 +1,11 @@
#ifndef DORICSCROLLERNODE_H
#define DORICSCROLLERNODE_H
#include "DoricExport.h"
#include "DoricSuperNode.h"
class DoricScrollerNode : public DoricSuperNode {
class DORIC_EXPORT DoricScrollerNode : public DoricSuperNode {
private:
DoricViewNode *mChildNode = nullptr;

View File

@ -1,9 +1,11 @@
#ifndef DORICSTACKNODE_H
#define DORICSTACKNODE_H
#include "DoricExport.h"
#include "DoricGroupNode.h"
class DoricStackNode : public DoricGroupNode {
class DORIC_EXPORT DoricStackNode : public DoricGroupNode {
public:
using DoricGroupNode::DoricGroupNode;

View File

@ -3,9 +3,11 @@
#include <QJsonArray>
#include "DoricExport.h"
#include "DoricViewNode.h"
class DoricSuperNode : public DoricViewNode {
class DORIC_EXPORT DoricSuperNode : public DoricViewNode {
private:
QMap<QString, QJsonValue> subNodes;

View File

@ -1,9 +1,11 @@
#ifndef DORICTEXTNODE_H
#define DORICTEXTNODE_H
#include "DoricExport.h"
#include "DoricViewNode.h"
class DoricTextNode : public DoricViewNode {
class DORIC_EXPORT DoricTextNode : public DoricViewNode {
public:
using DoricViewNode::DoricViewNode;

View File

@ -1,9 +1,11 @@
#ifndef DORICVLAYOUTNODE_H
#define DORICVLAYOUTNODE_H
#include "DoricExport.h"
#include "DoricGroupNode.h"
class DoricVLayoutNode : public DoricGroupNode {
class DORIC_EXPORT DoricVLayoutNode : public DoricGroupNode {
public:
using DoricGroupNode::DoricGroupNode;

View File

@ -5,12 +5,14 @@
#include <QJsonValue>
#include <QQuickItem>
#include "DoricExport.h"
#include "../utils/DoricContextHolder.h"
#include "../utils/DoricLayouts.h"
class DoricSuperNode;
class DoricViewNode : public DoricContextHolder {
class DORIC_EXPORT DoricViewNode : public DoricContextHolder {
protected:
QQuickItem *mView;

View File

@ -1,9 +1,11 @@
#ifndef DORICSLIDEITEMNODE_H
#define DORICSLIDEITEMNODE_H
#include "DoricExport.h"
#include "shader/DoricStackNode.h"
class DoricSlideItemNode : public DoricStackNode {
class DORIC_EXPORT DoricSlideItemNode : public DoricStackNode {
public:
using DoricStackNode::DoricStackNode;
};

View File

@ -1,10 +1,12 @@
#ifndef DORICSLIDERNODE_H
#define DORICSLIDERNODE_H
#include "DoricExport.h"
#include "DoricSlideItemNode.h"
#include "shader/DoricSuperNode.h"
class DoricSliderNode : public DoricSuperNode {
class DORIC_EXPORT DoricSliderNode : public DoricSuperNode {
private:
int itemCount = 0;

View File

@ -3,7 +3,9 @@
#include <QString>
class DoricConstant {
#include "DoricExport.h"
class DORIC_EXPORT DoricConstant {
public:
static const QString DORIC_BUNDLE_SANDBOX;

View File

@ -1,9 +1,11 @@
#ifndef DORICCONTEXTHOLDER_H
#define DORICCONTEXTHOLDER_H
#include "DoricExport.h"
#include "../DoricContext.h"
class DoricContextHolder : public QObject {
class DORIC_EXPORT DoricContextHolder : public QObject {
protected:
DoricContext *mContext = NULL;

View File

@ -3,7 +3,9 @@
#include <QObject>
class DoricDialogBridge : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricDialogBridge : public QObject {
Q_OBJECT
public:
explicit DoricDialogBridge(QObject *parent = nullptr);

View File

@ -3,7 +3,9 @@
#include <QObject>
class DoricImageBridge : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricImageBridge : public QObject {
Q_OBJECT
public:
explicit DoricImageBridge(QObject *parent = nullptr);

View File

@ -3,7 +3,9 @@
#include <QQuickItem>
class DoricLayoutType {
#include "DoricExport.h"
class DORIC_EXPORT DoricLayoutType {
public:
const static int DoricUndefined = 0;
const static int DoricStack = 1;
@ -11,14 +13,14 @@ public:
const static int DoricHLayout = 3;
};
class DoricLayoutSpec {
class DORIC_EXPORT DoricLayoutSpec {
public:
const static int DoricLayoutJust = 0;
const static int DoricLayoutFit = 1;
const static int DoricLayoutMost = 2;
};
class DoricGravity {
class DORIC_EXPORT DoricGravity {
public:
const static int DoricGravitySpecified = 1;
const static int DoricGravityStart = 1 << 1;
@ -41,7 +43,7 @@ public:
DoricGravityCenterX | DoricGravityCenterY;
};
class DoricLayouts : public QObject {
class DORIC_EXPORT DoricLayouts : public QObject {
public:
explicit DoricLayouts(QObject *parent = nullptr);

View File

@ -4,7 +4,9 @@
#include <QObject>
#include <QVariant>
class DoricMouseAreaBridge : public QObject {
#include "DoricExport.h"
class DORIC_EXPORT DoricMouseAreaBridge : public QObject {
Q_OBJECT
public:
explicit DoricMouseAreaBridge(QObject *parent = nullptr);

View File

@ -6,10 +6,12 @@
#include <QVariant>
#include <QtDebug>
#include "DoricExport.h"
#include "yoga/Yoga.h"
#include "FlexLayoutConfig.h"
class FlexLayout : public QObject {
class DORIC_EXPORT FlexLayout : public QObject {
Q_OBJECT
Q_PROPERTY(int flexShrink READ getFlexShrink WRITE setFlexShrink)

View File

@ -4,9 +4,11 @@
#include <QObject>
#include <QtDebug>
#include "DoricExport.h"
#include "yoga/Yoga.h"
class FlexLayoutConfig : public QObject {
class DORIC_EXPORT FlexLayoutConfig : public QObject {
Q_OBJECT
private:
YGConfigRef config;

View File

@ -6,12 +6,14 @@
#include <QVariant>
#include <QtDebug>
#include "DoricExport.h"
#include "FlexLayoutConfig.h"
#include "FlexLayout.h"
#include "yoga/Yoga.h"
class FlexLayoutService : public QObject {
class DORIC_EXPORT FlexLayoutService : public QObject {
Q_OBJECT
private:
FlexLayoutConfig *config;

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.14.2, 2021-05-18T14:22:08. -->
<!-- Written by QtCreator 4.14.2, 2021-05-18T14:32:35. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>