Skip to content

Commit

Permalink
Optionally build examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Feb 1, 2024
1 parent 22e9fbd commit 57ddc4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

option(ZEEP_BUILD_LIBRARY "Build the library from source code, should be off when configuring on ReadTheDocs" ON)
option(ZEEP_BUILD_DOCUMENTATION "Build documentation" OFF)
option(ZEEP_BUILD_EXAMPLES "Build the example applications" ON)
option(ZEEP_USE_BOOST_ASIO "Use the asio library from Boost instead of the non-boost version" ON)
option(ZEEP_ALLOW_FETCH_CONTENT "Use cmake's FetchContent to retrieve missing packages" ON)

Expand Down Expand Up @@ -315,6 +316,11 @@ if(ZEEP_BUILD_DOCUMENTATION)
add_subdirectory(docs)
endif()

# Examples
if(ZEEP_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

# Test applications, but only if we're not included as a subproject
get_directory_property(HAS_PARENT PARENT_DIRECTORY)

Expand Down
2 changes: 1 addition & 1 deletion examples/daemon-sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class hello_controller : public zh::controller
{
}

bool handle_request(zh::request &req, zh::reply &rep)
bool handle_request([[maybe_unused]] zh::request &req, zh::reply &rep)
{
/* Construct a simple reply with status OK (200) and content string */
rep = zh::reply::stock_reply(zh::ok);
Expand Down
2 changes: 1 addition & 1 deletion examples/http-server-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class hello_controller : public zeep::http::controller
/* Specify the root path as prefix, will handle any request URI */
hello_controller() : controller("/") {}

bool handle_request(zeep::http::request& req, zeep::http::reply& rep)
bool handle_request([[maybe_unused]] zeep::http::request& req, zeep::http::reply& rep)
{
/* Construct a simple reply with status OK (200) and content string */
rep = zeep::http::reply::stock_reply(zeep::http::ok);
Expand Down

0 comments on commit 57ddc4c

Please sign in to comment.