Skip to content

Commit f621bed

Browse files
committed
Since the only reason we used C++17 was to get std::optional, we downgrade to C++11 in CMakeLists. This commit imports version 3.5.0 of optional-lite.
1 parent 48724de commit f621bed

File tree

4 files changed

+1818
-11
lines changed

4 files changed

+1818
-11
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ add_library (cryptolens ${CRYPTOLENS_LIBRARY_TYPE} ${SRC})
4646
target_link_libraries (cryptolens ${LIBS})
4747
target_include_directories (cryptolens PRIVATE "${cryptolens_SOURCE_DIR}/include/cryptolens")
4848
target_include_directories (cryptolens PUBLIC "${cryptolens_SOURCE_DIR}/include")
49-
set_property (TARGET cryptolens PROPERTY CXX_STANDARD 17)
49+
set_property (TARGET cryptolens PROPERTY CXX_STANDARD 11)
5050
set_property (TARGET cryptolens PROPERTY CXX_STANDARD_REQUIRED ON)
5151

5252
if (${CRYPTOLENS_BUILD_TESTS})

examples/unix/cmake/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,30 @@ add_subdirectory ("../../.." "cryptolens-cpp")
3939

4040
add_executable(example_activate ../example_activate.cpp)
4141
target_link_libraries(example_activate cryptolens)
42-
set_property(TARGET example_activate PROPERTY CXX_STANDARD 17)
42+
set_property(TARGET example_activate PROPERTY CXX_STANDARD 11)
4343
set_property(TARGET example_activate PROPERTY CXX_STANDARD_REQUIRED ON)
4444
install(TARGETS example_activate DESTINATION bin)
4545

4646
add_executable(example_create_trial_key ../example_create_trial_key.cpp)
4747
target_link_libraries(example_create_trial_key cryptolens)
48-
set_property(TARGET example_create_trial_key PROPERTY CXX_STANDARD 17)
48+
set_property(TARGET example_create_trial_key PROPERTY CXX_STANDARD 11)
4949
set_property(TARGET example_create_trial_key PROPERTY CXX_STANDARD_REQUIRED ON)
5050
install(TARGETS example_create_trial_key DESTINATION bin)
5151

5252
add_executable(example_external ../example_external.cpp)
5353
target_link_libraries(example_external cryptolens)
54-
set_property(TARGET example_external PROPERTY CXX_STANDARD 17)
54+
set_property(TARGET example_external PROPERTY CXX_STANDARD 11)
5555
set_property(TARGET example_external PROPERTY CXX_STANDARD_REQUIRED ON)
5656
install(TARGETS example_external DESTINATION bin)
5757

5858
add_executable(example_floating ../example_floating.cpp)
5959
target_link_libraries(example_floating cryptolens)
60-
set_property(TARGET example_floating PROPERTY CXX_STANDARD 17)
60+
set_property(TARGET example_floating PROPERTY CXX_STANDARD 11)
6161
set_property(TARGET example_floating PROPERTY CXX_STANDARD_REQUIRED ON)
6262
install(TARGETS example_floating DESTINATION bin)
6363

6464
add_executable(example_offline ../example_offline.cpp)
6565
target_link_libraries(example_offline cryptolens)
66-
set_property(TARGET example_offline PROPERTY CXX_STANDARD 17)
66+
set_property(TARGET example_offline PROPERTY CXX_STANDARD 11)
6767
set_property(TARGET example_offline PROPERTY CXX_STANDARD_REQUIRED ON)
6868
install(TARGETS example_offline DESTINATION bin)

include/cryptolens/imports/std/optional

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
#ifdef CRYPTOLENS_SHORT_INCLUDE_PATHS
44

5-
#include <optional>
5+
#include <optional.hpp>
66

77
#else
88

9-
#include <optional>
9+
#include "../../../../third_party/optional-lite/optional.hpp"
1010

1111
#endif
1212

@@ -15,10 +15,10 @@ namespace cryptolens_io {
1515
namespace v20190401 {
1616

1717
template<typename T>
18-
using optional = std::optional<T>;
18+
using optional = ::nonstd::optional<T>;
1919

20-
using std::make_optional;
21-
using std::nullopt;
20+
using ::nonstd::make_optional;
21+
using ::nonstd::nullopt;
2222

2323
} // namespace v20190401
2424

0 commit comments

Comments
 (0)