From a6b897cdbc8bb3e9273cce6fc860cb0611656e5b Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Mon, 14 Jan 2019 11:45:25 +0100 Subject: [PATCH] Add QtCreator project for addon --- addon.pro | 24 ++++++++++++++++++++++++ src/AppWrapper.h | 4 ++++ src/HttpRequestWrapper.h | 5 +++++ src/HttpResponseWrapper.h | 5 +++++ src/Utilities.h | 5 +++++ src/WebSocketWrapper.h | 6 ++++++ 6 files changed, 49 insertions(+) create mode 100644 addon.pro diff --git a/addon.pro b/addon.pro new file mode 100644 index 00000000..925ccb3f --- /dev/null +++ b/addon.pro @@ -0,0 +1,24 @@ +TEMPLATE = app +CONFIG += console c++1z +CONFIG -= app_bundle +CONFIG -= qt + +SOURCES += \ + src/addon.cpp \ + uWebSockets/uSockets/src/eventing/epoll.c \ + uWebSockets/uSockets/src/context.c \ + uWebSockets/uSockets/src/socket.c \ + uWebSockets/uSockets/src/eventing/libuv.c \ + uWebSockets/uSockets/src/ssl.c \ + uWebSockets/uSockets/src/loop.c + +INCLUDEPATH += targets/node-v11.1.0/include/node +INCLUDEPATH += uWebSockets/src +INCLUDEPATH += uWebSockets/uSockets/src + +HEADERS += \ + src/AppWrapper.h \ + src/HttpRequestWrapper.h \ + src/HttpResponseWrapper.h \ + src/Utilities.h \ + src/WebSocketWrapper.h diff --git a/src/AppWrapper.h b/src/AppWrapper.h index 5c2d2108..3e7997cc 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -1,6 +1,10 @@ // App.post and all other methods - requires good templating? // test so that we pass Autobahn with compression/without compression with SSL/without SSL +/* Helping QtCreator */ +#include +#include "Utilities.h" +using namespace v8; /* uWS.App.ws('/pattern', options) */ template diff --git a/src/HttpRequestWrapper.h b/src/HttpRequestWrapper.h index 8b63d6f9..9518b0f6 100644 --- a/src/HttpRequestWrapper.h +++ b/src/HttpRequestWrapper.h @@ -2,6 +2,11 @@ // req.getUrl() // req.onAbort ? +/* Helping QtCreator */ +#include +#include "Utilities.h" +using namespace v8; + /* The only thing this req needs is getHeader and similar, getParameter, getUrl and so on */ Persistent reqTemplate; diff --git a/src/HttpResponseWrapper.h b/src/HttpResponseWrapper.h index f9ab9512..32a7a0c7 100644 --- a/src/HttpResponseWrapper.h +++ b/src/HttpResponseWrapper.h @@ -2,6 +2,11 @@ // res.write // res.tryEnd +/* Helping QtCreator */ +#include +#include "Utilities.h" +using namespace v8; + // this whole template thing could be one struct with members to order tihngs better Persistent resTemplate[2]; diff --git a/src/Utilities.h b/src/Utilities.h index 42f4abcd..bd971f82 100644 --- a/src/Utilities.h +++ b/src/Utilities.h @@ -1,3 +1,6 @@ +#ifndef ADDON_UTILITIES_H +#define ADDON_UTILITIES_H + class NativeString { char *data; size_t length; @@ -37,3 +40,5 @@ public: } } }; + +#endif diff --git a/src/WebSocketWrapper.h b/src/WebSocketWrapper.h index d124e373..3bd27245 100644 --- a/src/WebSocketWrapper.h +++ b/src/WebSocketWrapper.h @@ -2,6 +2,12 @@ // ws.close(lalala) // ws.? +/* Helping QtCreator */ +#include "App.h" +#include +#include "Utilities.h" +using namespace v8; + // also wrap all of this in some common struct Persistent wsTemplate[2];