File tree Expand file tree Collapse file tree 14 files changed +53
-27
lines changed
Expand file tree Collapse file tree 14 files changed +53
-27
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,18 @@ project(velocem LANGUAGES C CXX VERSION 0.0.13)
77option (VELOCEM_USE_IO_URING "Use io_uring on Linux" ON )
88option (VELOCEM_USE_IPO "Use interprocedural optimization if supported" ON )
99option (VELOCEM_STRIP "Run system strip on compiled module" ON )
10+ option (VELOCEM_GEN_IWYU_MAPPINGS "Generate Python mappings for IWYU" OFF )
1011set (VELOCEM_WIN_SDK_VER 0x0A00 CACHE STRING "Windows SDK macro version" )
1112
1213find_package (asio CONFIG REQUIRED)
1314find_package (llhttp CONFIG REQUIRED)
14- find_package (Python3 3.12 REQUIRED COMPONENTS Development.Module)
15+
16+ if (VELOCEM_GEN_IWYU_MAPPINGS)
17+ find_package (Python3 3.13 REQUIRED COMPONENTS Interpreter Development.Module)
18+ include (iwyu/GetIWYUMapGen.cmake)
19+ else ()
20+ find_package (Python3 3.13 REQUIRED COMPONENTS Development.Module)
21+ endif ()
1522
1623Python3_add_library(velocem MODULE)
1724target_link_libraries (velocem PRIVATE
Original file line number Diff line number Diff line change 1+ include (FetchContent)
2+
3+ FetchContent_Declare(
4+ pythonMapGen
5+ URL https://raw.githubusercontent.com/include -what-you-use/include -what-you-use/e4dd555000b824f11783d99b93d4a713fe34dd1d/mapgen/iwyu-mapgen-cpython.py
6+ URL_HASH SHA512=ef1e39cd9c735ca218d45e1f643cf06f73327446cc1d8ec8ced86503a0db727ae6b53ee879a979b214d9a5fa6a333daf5a6bf4ef821fd4a43ad44b34df3448bc
7+ DOWNLOAD_NO_EXTRACT TRUE
8+ )
9+ FetchContent_MakeAvailable(pythonMapGen)
10+
11+ execute_process (
12+ COMMAND ${Python3_EXECUTABLE} ${pythonmapgen_SOURCE_DIR} /iwyu-mapgen-cpython.py ${Python3_INCLUDE_DIRS}
13+ OUTPUT_FILE ${CMAKE_BINARY_DIR} /python_mappings.imp
14+ COMMAND_ECHO STDOUT
15+ )
16+
17+ list (APPEND CMAKE_CXX_INCLUDE_WHAT_YOU_USE -Xiwyu --mapping_file=${CMAKE_BINARY_DIR} /python_mappings.imp)
Original file line number Diff line number Diff line change 44#include < cstring>
55#include < span>
66#include < stdexcept>
7- #include < string_view>
8- #include < utility>
7+ #include < vector>
98
10- #include < asio.hpp>
9+ #include < asio/buffer .hpp>
1110#include < llhttp.h>
1211
12+ #include " util/BalmStringView.hpp"
13+ #include " wsgi/Input.hpp"
1314#include " wsgi/Request.hpp"
1415
1516namespace velocem {
Original file line number Diff line number Diff line change 22#define VELOCEM_HTTP_PARSER_HPP
33
44#include < cstddef>
5- #include < cstring>
65#include < span>
7- #include < stdexcept>
8- #include < string_view>
9- #include < utility>
106
11- #include < asio.hpp>
127#include < llhttp.h>
138
14- #include " wsgi/Request.hpp"
9+ namespace asio {
10+ class mutable_buffer ;
11+ }
12+ namespace velocem {
13+ struct WSGIRequest ;
14+ }
1515
1616namespace velocem {
1717
Original file line number Diff line number Diff line change 1-
2- #include < asio.hpp>
3-
1+ #include < asio/ip/tcp.hpp>
42#include < sys/socket.h>
53
64int set_reuse_port (asio::ip::tcp::acceptor& sock) {
Original file line number Diff line number Diff line change 22#define VELOCEM_CONSTANTS_HPP
33
44#include < array>
5- #include < chrono>
6- #include < format>
75#include < string>
86#include < string_view>
97
Original file line number Diff line number Diff line change 11#include " Util.hpp"
22
3- #include < cstdlib >
3+ #include < cstddef >
44#include < stdexcept>
55#include < string>
66#include < vector>
Original file line number Diff line number Diff line change 11#ifndef VELOCEM_UTIL_HPP
22#define VELOCEM_UTIL_HPP
33
4+ #include < cstddef>
45#include < string>
56#include < vector>
67
7- #include < asio.hpp>
8+ #include < asio/buffer .hpp>
89
910#include < Python.h>
1011
Original file line number Diff line number Diff line change 11#include " App.hpp"
22
3+ #include < array>
34#include < charconv>
4- #include < chrono>
55#include < cstdlib>
6+ #include < format>
67#include < optional>
78#include < queue>
89#include < ranges>
910#include < stdexcept>
11+ #include < system_error>
12+ #include < tuple>
1013#include < vector>
1114
1215#include < Python.h>
Original file line number Diff line number Diff line change 66
77#include < Python.h>
88
9- #include " Request.hpp"
9+ namespace velocem {
10+ struct WSGIRequest ;
11+ }
1012
1113namespace velocem {
1214
You can’t perform that action at this time.
0 commit comments