Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ add_subdirectory(third_party/expected-lite-0.6.3)
add_subdirectory(third_party/libunifex-0.4.0)

set(RESTINIO_ASIO_SOURCE "boost")
add_subdirectory(third_party/restinio-v.0.7.0/dev/restinio)
add_subdirectory(third_party/restinio-v.0.7.4/dev/restinio)

# TODO make it compile
#add_compile_options(-Werror -Wpedantic)
Expand Down
2 changes: 1 addition & 1 deletion accomodation/build_rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ RUN yum upgrade -y \
&& yum install -y -q boost-devel zlib-devel curl-devel

# env variable for spec file. watchman_cpp release version
ENV VERSION="1.0.3"
ENV VERSION="1.1.0"

ENTRYPOINT sh /mnt/watchman_cpp/accomodation/build_rpm/build_rpm.sh
4 changes: 4 additions & 0 deletions accomodation/etc/watchman_cpp_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"python": {
"image-name": "senjun_python",
"launched": 3
},
"cpp": {
"image-name": "senjun_cpp",
"launched": 3
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RESTinio - library for creating REST applications in c++.
Copyright (c) 2017-2023 Stiffstream <info at stiffstream dot com>. All rights reserved.
Copyright (c) 2017-2025 Stiffstream <info at stiffstream dot com>. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
27 changes: 27 additions & 0 deletions third_party/restinio-v.0.7.4/LICENSE.fmtlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--- Optional exception to the license ---

As an exception, if, as a result of your compiling your source code, portions
of this Software are embedded into a machine-executable object form of such
source code, you may redistribute such embedded portions in such object form
without including the above copyright and permission notices.
22 changes: 22 additions & 0 deletions third_party/restinio-v.0.7.4/LICENSE.llhttp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This software is licensed under the MIT License.

Copyright Fedor Indutny, 2018.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ else()
set(CMAKE_CXX_STANDARD 17)
endif()

if (NOT RESTINIO_EXPLICIT_WIN32_WINNT)
set(RESTINIO_EXPLICIT_WIN32_WINNT "0x0602") # Win8 by default
endif()

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

Expand Down Expand Up @@ -98,11 +102,22 @@ set_property(CACHE RESTINIO_DEP_FMT PROPERTY STRINGS "system;find;local")
set(RESTINIO_DEP_EXPECTED_LITE "local" CACHE STRING "How to get expected-lite dependency)")
set_property(CACHE RESTINIO_DEP_EXPECTED_LITE PROPERTY STRINGS "system;find;local")

# By default we assume to use an embedded version of Catch2.
set(RESTINIO_DEP_CATCH2 "local" CACHE STRING "How to get Catch2 dependency)")
set_property(CACHE RESTINIO_DEP_CATCH2 PROPERTY STRINGS "find;local")

# By default we assume to use an embedded version of SObjectizer.
set(RESTINIO_DEP_SOBJECTIZER "local" CACHE STRING "How to get SObjectizer dependency)")
set_property(CACHE RESTINIO_DEP_SOBJECTIZER PROPERTY STRINGS "system;find;local")


message(STATUS "RESTINIO_DEP_STANDALONE_ASIO: ${RESTINIO_DEP_STANDALONE_ASIO}")
message(STATUS "RESTINIO_DEP_BOOST_ASIO: ${RESTINIO_DEP_BOOST_ASIO}")
message(STATUS "RESTINIO_DEP_LLHTTP: ${RESTINIO_DEP_LLHTTP}")
message(STATUS "RESTINIO_DEP_FMT: ${RESTINIO_DEP_FMT}")
message(STATUS "RESTINIO_DEP_EXPECTED_LITE: ${RESTINIO_DEP_EXPECTED_LITE}")
message(STATUS "RESTINIO_DEP_CATCH2: ${RESTINIO_DEP_CATCH2}")
message(STATUS "RESTINIO_DEP_SOBJECTIZER: ${RESTINIO_DEP_SOBJECTIZER}")

set(RESTINIO_ASIO_SOURCE "standalone" CACHE STRING "What source of ASIO to use (standalone, boost)")
set(RESTINIO_ASIO_SOURCE_VALUES "standalone;boost")
Expand All @@ -124,10 +139,14 @@ endif ()
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so)" OFF)
option(BUILD_STATIC_LIBS "Build static libraries (.lib/.a)" ON)

if (WIN32)
add_compile_definitions(_WIN32_WINNT=${RESTINIO_EXPLICIT_WIN32_WINNT})
endif ()

if (MSVC)
add_compile_options(/W3)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_definitions(_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
add_compile_options(/utf-8)
endif ()

# ====================================================================
Expand All @@ -148,7 +167,7 @@ if (RESTINIO_ASIO_SOURCE STREQUAL "standalone")
else ()
if (RESTINIO_DEP_BOOST_ASIO STREQUAL "find")
find_package(Boost REQUIRED)
find_package(Boost REQUIRED COMPONENTS headers regex)
find_package(Boost REQUIRED COMPONENTS regex)
endif ()
endif ()

Expand Down Expand Up @@ -181,8 +200,24 @@ endif ()

if (RESTINIO_WITH_SOBJECTIZER)
message("========================================")
SET(SOBJECTIZER_BUILD_STATIC ON)
add_subdirectory(so_5)
if (RESTINIO_DEP_SOBJECTIZER STREQUAL "local")
message(STATUS "Add subdirectory so_5")
SET(SOBJECTIZER_BUILD_STATIC ON)
add_subdirectory(so_5)

set(RESTINIO_SOBJECTIZER_LIB_LINK_NAME "sobjectizer::StaticLib")
elseif (RESTINIO_DEP_SOBJECTIZER STREQUAL "find")
find_package(sobjectizer CONFIG REQUIRED)

set(RESTINIO_SOBJECTIZER_LIB_LINK_NAME "sobjectizer::StaticLib")
elseif (RESTINIO_DEP_SOBJECTIZER STREQUAL "system")
if (NOT RESTINIO_SOBJECTIZER_LIB_LINK_NAME)
message(FATAL_ERROR "The RESTINIO_SOBJECTIZER_LIB_LINK_NAME has to be "
"specified explicitly when RESTINIO_DEP_SOBJECTIZER is 'system'")
endif()
endif()

message(STATUS "RESTINIO_SOBJECTIZER_LIB_LINK_NAME: ${RESTINIO_SOBJECTIZER_LIB_LINK_NAME}")
message("========================================")
endif ()

Expand Down Expand Up @@ -219,12 +254,6 @@ IF (PCRE2_FOUND)
message( STATUS "PCRE2_INCLUDE_DIRS='" ${PCRE2_INCLUDE_DIRS} "'" )
ENDIF ()

# PCRE2
find_package(PCRE2)
IF (PCRE2_FOUND)
message( STATUS "PCRE2_LIBRARIES='" ${PCRE2_LIBRARIES} "'" )
message( STATUS "PCRE2_INCLUDE_DIRS='" ${PCRE2_INCLUDE_DIRS} "'" )
ENDIF ()
# ====================================================================

option(RESTINIO_GCC_CODE_COVERAGE "Build code coverage targets" OFF)
Expand Down Expand Up @@ -297,13 +326,21 @@ add_subdirectory(restinio)
message("========================================")

if (RESTINIO_TEST)
set(CATCH_INSTALL_DOCS OFF)
set(CATCH_INSTALL_EXTRAS OFF)
set(CATCH_DEVELOPMENT_BUILD OFF)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
add_subdirectory(catch2)
if (RESTINIO_DEP_CATCH2 STREQUAL "find")
find_package(Catch2 REQUIRED)
elseif (RESTINIO_DEP_CATCH2 STREQUAL "local")
message("========================================")
message(STATUS "Add subdirectory catch2")
set(CATCH_INSTALL_DOCS OFF)
set(CATCH_INSTALL_EXTRAS OFF)
set(CATCH_DEVELOPMENT_BUILD OFF)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
add_subdirectory(catch2)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/catch2/extras)
message("========================================")
endif ()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/catch2/extras)
include(Catch)

enable_testing()
Expand All @@ -319,3 +356,5 @@ if (RESTINIO_BENCHMARK)
include_directories("${CMAKE_SOURCE_DIR}/clara")
add_subdirectory(benches)
endif ()

# vim:ts=4:sts=4:sw=4:expandtab:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(BENCH _bench.restinio.single_handler_so5_timer)
include(${CMAKE_SOURCE_DIR}/cmake/bench.cmake)

if (RESTINIO_DEP_SOBJECTIZER STREQUAL "system")
target_compile_definitions(${BENCH} PRIVATE SO_5_STATIC_LIB)
endif()

target_link_libraries(${BENCH} PRIVATE ${RESTINIO_SOBJECTIZER_LIB_LINK_NAME})

target_link_libraries(${BENCH} PRIVATE restinio_helpers::cmd_line_args)

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

if(NOT RESTINIO_LIBRARY_NAME)
# That must be the case we RESTinio is used as a dependency.
# That must be the case when RESTinio is used as a dependency.
set(RESTINIO_LIBRARY_NAME restinio)
endif()

Expand Down Expand Up @@ -146,7 +146,7 @@ if ("${RESTINIO_EXPLICIT_CPPSTD}" STREQUAL "17"
# conditional block.
endif()

if (RESTINIO_DEP_FMT STREQUAL "system")
if (RESTINIO_DEP_EXPECTED_LITE STREQUAL "system")
message(STATUS "Using system expected-lite")
elseif (TARGET expected-lite::expected-lite)
target_link_libraries(${RESTINIO_LIBRARY_NAME} INTERFACE expected-lite::expected-lite)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if(RESTINIO_ASIO_SOURCE STREQUAL "standalone")
endif ()
else ()
if (RESTINIO_DEP_BOOST_ASIO STREQUAL "find")
find_dependency(boost)
find_dependency(Boost)
endif ()
endif ()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,69 +92,3 @@
#define RESTINIO_STATIC_ASSERT_NOT_NOEXCEPT(expr) \
static_assert(!noexcept(expr), #expr " is not expected to be noexcept" )

namespace restinio
{

namespace static_if_details
{

template< bool Condition >
struct static_if_impl;

template<>
struct static_if_impl<true>
{
template<typename If_Part, typename Else_Part>
static decltype(auto)
call( If_Part && if_part, Else_Part && )
{
return if_part();
}
};

template<>
struct static_if_impl<false>
{
template<typename If_Part, typename Else_Part>
static decltype(auto)
call( If_Part &&, Else_Part && else_part )
{
return else_part();
}
};

} /* namespace static_if_details */

//
// static_if_else
//
/*!
* @brief An emulation of if constexpr for C++14.
*
* Usage example:
* @code
* static_if_else< noexcept(some-expression) >(
* []() noexcept {
* ... // Some action that doesn't throw.
* },
* [] {
* try {
* ... // Some action that throws.
* }
* catch(...) {}
* });
* @endcode
*
* @since v.0.6.1.1
*/
template< bool Condition, typename If_Part, typename Else_Part >
decltype(auto)
static_if_else( If_Part && if_part, Else_Part && else_part )
{
return static_if_details::static_if_impl<Condition>::call(
std::forward<If_Part>(if_part),
std::forward<Else_Part>(else_part) );
}

} /* namespace restinio */

Loading