diff options
author | Aaron Seigo <aseigo@kde.org> | 2014-12-14 13:09:14 +0100 |
---|---|---|
committer | Aaron Seigo <aseigo@kde.org> | 2014-12-14 13:14:45 +0100 |
commit | 08b975293c356f7a39ca28aa5bc243fe3281d361 (patch) | |
tree | daac674d35e3849af0677f75cfe94bc705f13c24 | |
parent | e593cb6acf0d66eb363690be00dddeeeb97d9b11 (diff) | |
download | sink-08b975293c356f7a39ca28aa5bc243fe3281d361.tar.gz sink-08b975293c356f7a39ca28aa5bc243fe3281d361.zip |
compile ixes, make akonadi2common an actual shared lib
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | common/CMakeLists.txt | 4 | ||||
-rw-r--r-- | common/commands.h | 5 | ||||
-rw-r--r-- | common/console.h | 4 | ||||
-rw-r--r-- | common/storage.h | 3 | ||||
-rw-r--r-- | common/storage_unqlite.cpp | 4 | ||||
-rw-r--r-- | common/unqlite/unqlite.h | 2 | ||||
-rw-r--r-- | tests/storagebenchmark.cpp | 11 |
8 files changed, 18 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f86163..0373671 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -36,7 +36,7 @@ endfunction(generate_flatbuffers) | |||
36 | 36 | ||
37 | set(CMAKE_AUTOMOC ON) | 37 | set(CMAKE_AUTOMOC ON) |
38 | add_definitions("-Wall -std=c++0x") | 38 | add_definitions("-Wall -std=c++0x") |
39 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${FLATBUFFERS_INCLUDE_DIR}) | 39 | include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/common ${FLATBUFFERS_INCLUDE_DIR}) |
40 | 40 | ||
41 | configure_file(hawd.conf hawd.conf) | 41 | configure_file(hawd.conf hawd.conf) |
42 | 42 | ||
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index dc9a670..c0cc7d9 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt | |||
@@ -16,8 +16,8 @@ set(command_SRCS | |||
16 | storage_common.cpp | 16 | storage_common.cpp |
17 | ${storage_SRCS}) | 17 | ${storage_SRCS}) |
18 | 18 | ||
19 | message("We have: ${storage_SRCS}") | 19 | add_library(${PROJECT_NAME} SHARED ${command_SRCS}) |
20 | add_library(${PROJECT_NAME} ${command_SRCS}) | 20 | generate_export_header(${PROJECT_NAME} BASE_NAME Akonadi2Common EXPORT_FILE_NAME akonadi2common_export.h) |
21 | SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) | 21 | SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) |
22 | qt5_use_modules(${PROJECT_NAME} Widgets) | 22 | qt5_use_modules(${PROJECT_NAME} Widgets) |
23 | target_link_libraries(${PROJECT_NAME} ${storage_LIBS}) | 23 | target_link_libraries(${PROJECT_NAME} ${storage_LIBS}) |
diff --git a/common/commands.h b/common/commands.h index 534308d..5f2b006 100644 --- a/common/commands.h +++ b/common/commands.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include <akonadi2common_export.h> | ||
3 | #include <flatbuffers/flatbuffers.h> | 4 | #include <flatbuffers/flatbuffers.h> |
4 | 5 | ||
5 | class QIODevice; | 6 | class QIODevice; |
@@ -14,6 +15,6 @@ enum CommandIds { | |||
14 | CustomCommand = 0xffff | 15 | CustomCommand = 0xffff |
15 | }; | 16 | }; |
16 | 17 | ||
17 | void write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb); | 18 | void AKONADI2COMMON_EXPORT write(QIODevice *device, int commandId, flatbuffers::FlatBufferBuilder &fbb); |
18 | 19 | ||
19 | } \ No newline at end of file | 20 | } |
diff --git a/common/console.h b/common/console.h index d36ce05..0df5c38 100644 --- a/common/console.h +++ b/common/console.h | |||
@@ -1,11 +1,13 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include <akonadi2common_export.h> | ||
4 | |||
3 | #include <QTime> | 5 | #include <QTime> |
4 | #include <QWidget> | 6 | #include <QWidget> |
5 | 7 | ||
6 | class QTextBrowser; | 8 | class QTextBrowser; |
7 | 9 | ||
8 | class Console : public QWidget | 10 | class AKONADI2COMMON_EXPORT Console : public QWidget |
9 | { | 11 | { |
10 | Q_OBJECT | 12 | Q_OBJECT |
11 | public: | 13 | public: |
diff --git a/common/storage.h b/common/storage.h index 3f14e83..2fac068 100644 --- a/common/storage.h +++ b/common/storage.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #pragma once | 1 | #pragma once |
2 | 2 | ||
3 | #include <akonadi2common_export.h> | ||
3 | #include <string> | 4 | #include <string> |
4 | #include <functional> | 5 | #include <functional> |
5 | #include <QString> | 6 | #include <QString> |
6 | 7 | ||
7 | class Storage { | 8 | class AKONADI2COMMON_EXPORT Storage { |
8 | public: | 9 | public: |
9 | enum AccessMode { ReadOnly, ReadWrite }; | 10 | enum AccessMode { ReadOnly, ReadWrite }; |
10 | 11 | ||
diff --git a/common/storage_unqlite.cpp b/common/storage_unqlite.cpp index f94643f..2bdfc2c 100644 --- a/common/storage_unqlite.cpp +++ b/common/storage_unqlite.cpp | |||
@@ -9,7 +9,9 @@ | |||
9 | #include <QString> | 9 | #include <QString> |
10 | #include <QTime> | 10 | #include <QTime> |
11 | 11 | ||
12 | #include "unqlite/unqlite.h" | 12 | extern "C" { |
13 | #include "unqlite/unqlite.h" | ||
14 | } | ||
13 | 15 | ||
14 | static const char *s_unqliteDir = "/unqlite/"; | 16 | static const char *s_unqliteDir = "/unqlite/"; |
15 | 17 | ||
diff --git a/common/unqlite/unqlite.h b/common/unqlite/unqlite.h index 2a2b1ad..bf7ee50 100644 --- a/common/unqlite/unqlite.h +++ b/common/unqlite/unqlite.h | |||
@@ -946,4 +946,4 @@ UNQLITE_APIEXPORT const char * unqlite_lib_signature(void); | |||
946 | UNQLITE_APIEXPORT const char * unqlite_lib_ident(void); | 946 | UNQLITE_APIEXPORT const char * unqlite_lib_ident(void); |
947 | UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void); | 947 | UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void); |
948 | 948 | ||
949 | #endif /* _UNQLITE_H_ */ \ No newline at end of file | 949 | #endif /* _UNQLITE_H_ */ |
diff --git a/tests/storagebenchmark.cpp b/tests/storagebenchmark.cpp index 130753f..33898d3 100644 --- a/tests/storagebenchmark.cpp +++ b/tests/storagebenchmark.cpp | |||
@@ -93,16 +93,11 @@ private Q_SLOTS: | |||
93 | 93 | ||
94 | time.start(); | 94 | time.start(); |
95 | { | 95 | { |
96 | auto event = createEvent(); | 96 | auto event = std::string(500, '1');//createEvent(); |
97 | |||
98 | if (store) store->startTransaction(); | ||
97 | for (int i = 0; i < count; i++) { | 99 | for (int i = 0; i < count; i++) { |
98 | if (store) { | 100 | if (store) { |
99 | if (i % 10000 == 0) { | ||
100 | if (i > 0) { | ||
101 | store->commitTransaction(); | ||
102 | } | ||
103 | store->startTransaction(); | ||
104 | } | ||
105 | |||
106 | store->write(keyPrefix + std::to_string(i), event); | 101 | store->write(keyPrefix + std::to_string(i), event); |
107 | } else { | 102 | } else { |
108 | myfile << event; | 103 | myfile << event; |