diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3b222e42..2894e13f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,4 +21,6 @@ add_executable(example example.cpp) target_link_libraries(example cxxopts) -set_property(TARGET example PROPERTY CXX_STANDARD 17) +target_compile_features(example PRIVATE cxx_std_17) +target_compile_options(example PRIVATE + "$<$:/utf-8;>") diff --git a/test/options.cpp b/test/options.cpp index bb90f825..647934c5 100644 --- a/test/options.cpp +++ b/test/options.cpp @@ -848,11 +848,11 @@ TEST_CASE("Optional value", "[optional]") CHECK(result.as_optional("int")); CHECK(result.as_optional("float")); - CHECK(result.as_optional("string")); + CHECK(result.as_optional("string")); CHECK(*result.as_optional("int") == 42); CHECK(*result.as_optional("float") == 3.141); - CHECK(*result.as_optional("string") == "Hello"); + CHECK(*result.as_optional("string") == "Hello"); } SECTION("Unavailable") { @@ -866,7 +866,7 @@ TEST_CASE("Optional value", "[optional]") CHECK(!result.as_optional("int")); CHECK(!result.as_optional("float")); - CHECK(!result.as_optional("string")); + CHECK(!result.as_optional("string")); } }