Skip to content

Commit 69d2c11

Browse files
jinyuqiJin Yuqi (Ricky)
and
Jin Yuqi (Ricky)
authored
Fix build failed for cxxopt submodule updating (cpp-netlib#886)
Co-authored-by: Jin Yuqi (Ricky) <[email protected]>
1 parent 59fabb8 commit 69d2c11

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

libs/network/example/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR})
77
include_directories(${CPP-NETLIB_SOURCE_DIR}/deps/cxxopts/src)
8+
include_directories(${CPP-NETLIB_SOURCE_DIR}/deps/cxxopts/include)
89
if (OPENSSL_FOUND)
910
include_directories(${OPENSSL_INCLUDE_DIR})
1011
endif (OPENSSL_FOUND)

libs/network/example/http_client.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@ int main(int argc, char* argv[]) {
2929
;
3030

3131
options.parse_positional(std::vector<std::string>{"source"});
32-
options.parse(argc, argv);
32+
auto optionsResults = options.parse(argc, argv);
3333

34-
if (options.count("help")) {
34+
if (optionsResults.count("help")) {
3535
std::cout << options.help({"", "Group"}) << std::endl;
3636
return EXIT_SUCCESS;
3737
}
3838

39-
if (options.count("source") < 1) {
39+
if (optionsResults.count("source") < 1) {
4040
std::cout << "Error: Source URL required." << std::endl;
4141
std::cout << options.help({"", "Group"}) << std::endl;
4242
return EXIT_FAILURE;
4343
}
4444

45-
std::string source = options["source"].as<std::string>();
46-
bool show_headers = options.count("headers") ? true : false;
47-
bool show_status = options.count("status") ? true : false;
45+
std::string source = optionsResults["source"].as<std::string>();
46+
bool show_headers = optionsResults.count("headers") ? true : false;
47+
bool show_status = optionsResults.count("status") ? true : false;
4848

4949
http::client::request request(source);
5050
http::client::string_type destination_ = host(request);

0 commit comments

Comments
 (0)