Unverified Commit 19aa1137 authored by Kip's avatar Kip Committed by GitHub

Merge pull request #936 from Tachi107/test-dependencies

Make date.h and cpp-httplib proper dependencies
parents c7313b97 70c561f8
...@@ -36,8 +36,11 @@ ...@@ -36,8 +36,11 @@
.idea .idea
# Clangd cache # Clangd cache
.cache /.cache/clangd
# Meson Wrap DB cache # Meson Wrap DB cache
/subprojects/* /subprojects/*
!/subprojects/*.wrap !/subprojects/*.wrap
!/subprojects/cpp-httplib
!/subprojects/hinnant-date
...@@ -21,6 +21,7 @@ Pistache has the following third party dependencies ...@@ -21,6 +21,7 @@ Pistache has the following third party dependencies
- [Googletest](https://github.com/google/googletest) - [Googletest](https://github.com/google/googletest)
- [OpenSSL](https://www.openssl.org/) - [OpenSSL](https://www.openssl.org/)
- [RapidJSON](https://rapidjson.org/) - [RapidJSON](https://rapidjson.org/)
- [Hinnant Date](https://github.com/HowardHinnant/date)
## Contributing ## Contributing
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <pistache/endpoint.h> #include <pistache/endpoint.h>
#include <pistache/http.h> #include <pistache/http.h>
#include <pistache/thirdparty/serializer/rapidjson.h> #include <pistache/serializer/rapidjson.h>
using namespace Pistache; using namespace Pistache;
......
This diff is collapsed.
...@@ -24,7 +24,12 @@ if get_option('b_coverage') ...@@ -24,7 +24,12 @@ if get_option('b_coverage')
add_project_arguments(compiler.get_supported_arguments(['-fstack-protector-all', '--param=ssp-buffer-size=4']), language: 'cpp') add_project_arguments(compiler.get_supported_arguments(['-fstack-protector-all', '--param=ssp-buffer-size=4']), language: 'cpp')
endif endif
deps_libpistache = [dependency('threads'), dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep'])] date_dep = dependency('hinnant-date', fallback: ['hinnant-date', 'date_dep'])
deps_libpistache = [
dependency('threads'),
dependency('RapidJSON', fallback: ['rapidjson', 'rapidjson_dep']),
date_dep
]
# Check if -latomic is needed - https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/CheckAtomic.cmake # Check if -latomic is needed - https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/CheckAtomic.cmake
compiler_id = compiler.get_id() compiler_id = compiler.get_id()
......
...@@ -42,6 +42,7 @@ else() ...@@ -42,6 +42,7 @@ else()
target_include_directories(pistache PRIVATE ${RAPIDJSON_INCLUDE_DIRS}) target_include_directories(pistache PRIVATE ${RAPIDJSON_INCLUDE_DIRS})
endif() endif()
target_include_directories(pistache PRIVATE ${CMAKE_SOURCE_DIR}/subprojects/hinnant-date/include)
target_include_directories(pistache PUBLIC ${PISTACHE_INCLUDE}) target_include_directories(pistache PUBLIC ${PISTACHE_INCLUDE})
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion" #pragma GCC diagnostic ignored "-Wconversion"
#endif #endif
#include <pistache/thirdparty/date.h> #include <date/date.h>
#ifdef __GNUC__ #ifdef __GNUC__
#pragma GCC diagnostic pop #pragma GCC diagnostic pop
#endif #endif
......
The MIT License (MIT)
Copyright (c) 2017 yhirose
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.
This diff is collapsed.
project(
'cpp-httplib',
'cpp',
license: 'MIT',
version: '0.9.0'
)
cpp_httplib_dep = declare_dependency(include_directories: include_directories('.'))
if meson.version().version_compare('>=0.54.0')
meson.override_dependency('cpp-httplib', cpp_httplib_dep)
endif
The source code in this project is released using the MIT License. There is no
global license for the project because each file is licensed individually with
different author names and/or dates.
If you contribute to this project, please add your name to the license of each
file you modify. If you have already contributed to this project and forgot to
add your name to the license, please feel free to submit a new P/R to add your
name to the license in each file you modified.
For convenience, here is a copy of the MIT license found in each file except
without author names or dates:
The MIT License (MIT)
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.
This diff is collapsed.
project(
'hinnant-date',
'cpp',
license: 'MIT',
version: '3.0.1'
)
date_dep = declare_dependency(include_directories: include_directories('include'))
...@@ -5,7 +5,11 @@ function(pistache_test test_name) ...@@ -5,7 +5,11 @@ function(pistache_test test_name)
set(TEST_SOURCE ${test_name}.cc) set(TEST_SOURCE ${test_name}.cc)
add_executable(${TEST_EXECUTABLE} ${TEST_SOURCE}) add_executable(${TEST_EXECUTABLE} ${TEST_SOURCE})
target_include_directories(${TEST_EXECUTABLE} PRIVATE ${CURL_INCLUDE_DIRS}) target_include_directories(${TEST_EXECUTABLE} PRIVATE
${CURL_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/subprojects/hinnant-date/include
${CMAKE_SOURCE_DIR}/subprojects/cpp-httplib
)
# CMake 3.20 and upstream GTest define GTest::gtest, older versions define GTest::GTest # CMake 3.20 and upstream GTest define GTest::gtest, older versions define GTest::GTest
if (TARGET GTest::gtest) if (TARGET GTest::gtest)
target_link_libraries(${TEST_EXECUTABLE} GTest::gtest GTest::gtest_main pistache_static ${CURL_LIBRARIES}) target_link_libraries(${TEST_EXECUTABLE} GTest::gtest GTest::gtest_main pistache_static ${CURL_LIBRARIES})
......
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <pistache/cookie.h> #include <pistache/cookie.h>
#include <pistache/thirdparty/date.h> #include <date/date.h>
using namespace Pistache; using namespace Pistache;
using namespace Pistache::Http; using namespace Pistache::Http;
......
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include <pistache/cookie.h> #include <pistache/cookie.h>
#include <pistache/thirdparty/date.h> #include <date/date.h>
using namespace Pistache; using namespace Pistache;
using namespace Pistache::Http; using namespace Pistache::Http;
......
#include <pistache/http.h> #include <pistache/http.h>
#include <pistache/thirdparty/date.h> #include <date/date.h>
#include "gtest/gtest.h" #include "gtest/gtest.h"
......
This diff is collapsed.
curl_dep = dependency('libcurl') curl_dep = dependency('libcurl')
gtest_main_dep = dependency('gtest', main: true, fallback: ['gtest', 'gtest_main_dep']) gtest_main_dep = dependency('gtest', main: true, fallback: ['gtest', 'gtest_main_dep'])
cpp_httplib_dep = dependency('cpp-httplib', fallback: ['cpp-httplib', 'cpp_httplib_dep'])
pistache_test_files = [ pistache_test_files = [
'mime_test', 'mime_test',
...@@ -43,7 +44,9 @@ foreach test_name : pistache_test_files ...@@ -43,7 +44,9 @@ foreach test_name : pistache_test_files
dependencies: [ dependencies: [
pistache_dep, pistache_dep,
gtest_main_dep, gtest_main_dep,
curl_dep curl_dep,
cpp_httplib_dep,
date_dep
] ]
), ),
timeout: 60, timeout: 60,
......
...@@ -139,7 +139,7 @@ TEST(request_size, manual_construction) ...@@ -139,7 +139,7 @@ TEST(request_size, manual_construction)
} }
private: private:
tag placeholder; [[maybe_unused]] tag placeholder;
}; };
// General test parameters. // General test parameters.
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <pistache/peer.h> #include <pistache/peer.h>
#include <pistache/router.h> #include <pistache/router.h>
#include "httplib.h" #include <httplib.h>
using namespace std; using namespace std;
using namespace Pistache; using namespace Pistache;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <pistache/http.h> #include <pistache/http.h>
#include <pistache/router.h> #include <pistache/router.h>
#include "httplib.h" #include <httplib.h>
using namespace Pistache; using namespace Pistache;
using namespace Pistache::Rest; using namespace Pistache::Rest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment