File tree Expand file tree Collapse file tree 6 files changed +112
-30
lines changed Expand file tree Collapse file tree 6 files changed +112
-30
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,101 @@ language: cpp
2
2
3
3
sudo : false
4
4
5
- addons :
6
- apt :
7
- sources :
8
- - ubuntu-toolchain-r-test
9
- - llvm-toolchain-precise-3.7
10
- - george-edison55-precise-backports
11
- packages :
12
- - gcc-5
13
- - g++-5
14
- - clang-3.7
15
- - cmake
16
- - cmake-data
17
- - libsparsehash-dev
18
-
19
5
matrix :
20
6
include :
21
- - os : linux
22
- compiler : gcc
23
- env : CCC=gcc-5 CCXX=g++-5
24
- - os : linux
7
+
8
+ # clang-4
9
+ - env : COMPILER=clang++-4.0
10
+ compiler : clang
11
+ os : linux
12
+ addons :
13
+ apt :
14
+ packages :
15
+ - clang-4.0
16
+ - libstdc++-6-dev
17
+ - libsparsehash-dev
18
+ sources :
19
+ - ubuntu-toolchain-r-test
20
+ - llvm-toolchain-trusty-4.0
21
+
22
+ # clang-5
23
+ - env : COMPILER=clang++-5.0
24
+ compiler : clang
25
+ os : linux
26
+ addons :
27
+ apt :
28
+ packages :
29
+ - clang-5.0
30
+ - libstdc++-7-dev
31
+ - libsparsehash-dev
32
+ sources :
33
+ - ubuntu-toolchain-r-test
34
+ - llvm-toolchain-trusty-5.0
35
+
36
+ # clang-6
37
+ - env : COMPILER=clang++-6.0
25
38
compiler : clang
26
- env : CCC=clang-3.7 CCXX=clang++-3.7
27
-
39
+ os : linux
40
+ addons :
41
+ apt :
42
+ packages :
43
+ - clang-6.0
44
+ - libstdc++-7-dev
45
+ - libsparsehash-dev
46
+ sources :
47
+ - ubuntu-toolchain-r-test
48
+ - llvm-toolchain-trusty-6.0
49
+
50
+ # gcc-5
51
+ - env : COMPILER=g++-5
52
+ compiler : gcc
53
+ os : linux
54
+ addons :
55
+ apt :
56
+ packages :
57
+ - g++-5
58
+ - libsparsehash-dev
59
+ sources :
60
+ - ubuntu-toolchain-r-test
61
+
62
+ # gcc-6
63
+ - env : COMPILER=g++-6
64
+ compiler : gcc
65
+ os : linux
66
+ addons :
67
+ apt :
68
+ packages :
69
+ - g++-6
70
+ - libsparsehash-dev
71
+ sources :
72
+ - ubuntu-toolchain-r-test
73
+
74
+ # gcc-7
75
+ - env : COMPILER=g++-7
76
+ compiler : gcc
77
+ os : linux
78
+ addons :
79
+ apt :
80
+ packages :
81
+ - g++-7
82
+ - libsparsehash-dev
83
+ sources :
84
+ - ubuntu-toolchain-r-test
85
+
86
+ # gcc-8
87
+ - env : COMPILER=g++-8
88
+ compiler : gcc
89
+ os : linux
90
+ addons :
91
+ apt :
92
+ packages :
93
+ - g++-8
94
+ - libsparsehash-dev
95
+ sources :
96
+ - ubuntu-toolchain-r-test
97
+
28
98
before_script :
29
- - export CC=$CCC CXX=$CCXX
99
+ - export CXX=$COMPILER
30
100
- mkdir build
31
101
- cd build
32
102
- cmake --version
Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.2 )
2
- project (HashMap )
2
+ project (HashMap CXX )
3
3
4
4
set (CMAKE_EXPORT_COMPILE_COMMANDS "true" )
5
- set (CMAKE_CXX_FLAGS "-std=c++14 -Wall -Wextra -pedantic -g" )
5
+ set (CMAKE_CXX_STANDARD 14 )
6
6
7
- add_executable (HashMapBenchmark HashMapBenchmark.cpp )
8
- add_executable (HashMapExample HashMapExample.cpp )
9
- add_executable (HashMapTest HashMapTest.cpp )
7
+ add_compile_options (-Wall -Wextra -Wpedantic -Werror )
8
+
9
+ add_library (HashMap INTERFACE )
10
+ target_include_directories (HashMap INTERFACE
11
+ $< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>
12
+ $< INSTALL_INTERFACE:include> )
13
+
14
+ add_executable (HashMapBenchmark src/HashMapBenchmark.cpp )
15
+ target_link_libraries (HashMapBenchmark HashMap )
16
+
17
+ add_executable (HashMapExample src/HashMapExample.cpp )
18
+ target_link_libraries (HashMapExample HashMap )
19
+
20
+ add_executable (HashMapTest src/HashMapTest.cpp )
21
+ target_link_libraries (HashMapTest HashMap )
10
22
11
23
enable_testing ()
12
24
add_test (HashMapTest HashMapTest )
File renamed without changes.
Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
SOFTWARE.
21
21
*/
22
22
23
- #include " HashMap.h"
24
23
#include < chrono>
25
24
#include < google/dense_hash_map>
26
25
#include < iostream>
27
26
#include < random>
27
+ #include < rigtorp/HashMap.h>
28
28
#include < unordered_map>
29
29
30
30
using namespace rigtorp ;
@@ -36,7 +36,7 @@ int main(int argc, char *argv[]) {
36
36
constexpr size_t count = 1000 ;
37
37
constexpr size_t iters = 100000000 ;
38
38
39
- auto b = [count, iters ](const char *n, auto &m) {
39
+ auto b = [](const char *n, auto &m) {
40
40
std::mt19937 mt;
41
41
std::uniform_int_distribution<int > ud (2 , count);
42
42
Original file line number Diff line number Diff line change 1
- #include " HashMap.h"
2
1
#include < iostream>
2
+ #include < rigtorp/HashMap.h>
3
3
4
4
int main (int argc, char *argv[]) {
5
5
(void )argc, (void )argv;
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
20
SOFTWARE.
21
21
*/
22
22
23
- #include " HashMap.h"
24
23
#include < algorithm>
25
24
#include < array>
25
+ #include < rigtorp/HashMap.h>
26
26
27
27
using namespace rigtorp ;
28
28
You can’t perform that action at this time.
0 commit comments