Skip to content

Commit 265bbc6

Browse files
committed
adding CMake style building of tests
adding typename that is needed according to newest versions of gcc
1 parent 7667a20 commit 265bbc6

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required (VERSION 3.0)
2+
3+
project(cpp-json CXX)
4+
5+
set(json_SOURCES
6+
include/cpp-json/object.h
7+
include/cpp-json/array.tcc
8+
include/cpp-json/json.h
9+
include/cpp-json/exception.h
10+
include/cpp-json/value.h
11+
include/cpp-json/parser.h
12+
include/cpp-json/value.tcc
13+
include/cpp-json/array.h
14+
include/cpp-json/json.tcc
15+
include/cpp-json/object.tcc
16+
include/cpp-json/parser.tcc
17+
)
18+
19+
include_directories(include)
20+
21+
add_executable(example1 example1.cc ${json_SOURCES})
22+
add_executable(example2 example2.cc ${json_SOURCES})
23+
add_executable(example3 example3.cc ${json_SOURCES})
24+
add_executable(example4 example4.cc ${json_SOURCES})
25+
26+
set_property(TARGET example1 PROPERTY CXX_STANDARD 11)
27+
set_property(TARGET example2 PROPERTY CXX_STANDARD 11)
28+
set_property(TARGET example3 PROPERTY CXX_STANDARD 11)
29+
set_property(TARGET example4 PROPERTY CXX_STANDARD 11)
30+
31+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -W -Wall -Wmissing-field-initializers -Wunused -Wshadow")

include/cpp-json/value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class value {
4848
value(const char *s);
4949
value(const object &o);
5050
value(std::string s);
51-
template <class T, typename = std::enable_if<std::is_arithmetic<T>::value>::type>
51+
template <class T, typename = typename std::enable_if<std::is_arithmetic<T>::value>::type>
5252
value(T n);
5353
value(const std::nullptr_t &);
5454

0 commit comments

Comments
 (0)