File tree Expand file tree Collapse file tree 6 files changed +33
-10
lines changed Expand file tree Collapse file tree 6 files changed +33
-10
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,21 @@ set_target_properties(${STATIC_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
35
35
set_target_properties (${SHARED_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1 )
36
36
37
37
# Some special headers.
38
- include (CheckIncludeFileCXX )
39
- check_include_file_cxx (string_view HAVE_STRING_VIEW )
40
- check_include_file_cxx (optional HAVE_OPTIONAL )
41
- configure_file (${CMAKE_CURRENT_SOURCE_DIR} /config.h.in ${PROJECT_SOURCE_DIR} /config.h )
38
+ try_compile (HAVE_STRING_VIEW
39
+ "${CMAKE_CURRENT_BINARY_DIR} /try_compile"
40
+ "${CMAKE_CURRENT_SOURCE_DIR} /try_compile/try_string_view.cpp" )
41
+
42
+ if (HAVE_STRING_VIEW )
43
+ add_definitions (-DHAVE_STRING_VIEW )
44
+ endif ()
45
+
46
+ try_compile (HAVE_OPTIONAL
47
+ "${CMAKE_CURRENT_BINARY_DIR} /try_compile"
48
+ "${CMAKE_CURRENT_SOURCE_DIR} /try_compile/try_optional.cpp" )
49
+
50
+ if (HAVE_OPTIONAL )
51
+ add_definitions (-DHAVE_OPTIONAL )
52
+ endif ()
42
53
43
54
add_subdirectory (test )
44
55
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 21
21
#include < string>
22
22
#include < type_traits>
23
23
24
- #include " config.h"
25
-
26
24
#ifdef HAVE_STRING_VIEW
27
25
28
26
#include < string_view>
Original file line number Diff line number Diff line change 6
6
cmake_minimum_required (VERSION 2.8.0 )
7
7
endif ()
8
8
9
- set (CMAKE_CXX_FLAGS "-std=c++11 -Wall -W -Werror -fPIC" )
10
-
11
9
set (PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR} /src/sw/redis++ )
12
10
13
11
file (GLOB PROJECT_SOURCE_FILES "${PROJECT_SOURCE_DIR} /*.cpp" )
Original file line number Diff line number Diff line change
1
+ #include < optional>
2
+
3
+ std::optional func () {
4
+ return {};
5
+ }
6
+
7
+ int main () {
8
+ return 0 ;
9
+ }
Original file line number Diff line number Diff line change
1
+ #include < string_view>
2
+
3
+ std::string_view func () {
4
+ return {};
5
+ }
6
+
7
+ int main () {
8
+ return 0 ;
9
+ }
You can’t perform that action at this time.
0 commit comments