refactor(eventsub): generate entire files (#5897)

This commit is contained in:
nerix
2025-02-05 16:53:25 +01:00
committed by GitHub
parent 5e3412c3bb
commit 449aefc6bc
54 changed files with 972 additions and 922 deletions
+20 -18
View File
@@ -1,3 +1,21 @@
generate_json_impls(
OUTPUT_SOURCES eventsub_generated_sources
BASE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/.."
FORCE ${FORCE_JSON_GENERATION}
HEADERS
include/twitch-eventsub-ws/messages/metadata.hpp
include/twitch-eventsub-ws/payloads/channel-ban-v1.hpp
include/twitch-eventsub-ws/payloads/channel-chat-message-v1.hpp
include/twitch-eventsub-ws/payloads/channel-chat-notification-v1.hpp
include/twitch-eventsub-ws/payloads/channel-moderate-v2.hpp
include/twitch-eventsub-ws/payloads/channel-update-v1.hpp
include/twitch-eventsub-ws/payloads/session-welcome.hpp
include/twitch-eventsub-ws/payloads/stream-offline-v1.hpp
include/twitch-eventsub-ws/payloads/stream-online-v1.hpp
include/twitch-eventsub-ws/payloads/subscription.hpp
)
set(SOURCE_FILES
session.cpp
@@ -6,20 +24,11 @@ set(SOURCE_FILES
json.cpp
string.cpp
payloads/subscription.cpp
payloads/session-welcome.cpp
# Subscription types
# Subscription types (only additional functions)
payloads/channel-ban-v1.cpp
payloads/stream-online-v1.cpp
payloads/stream-offline-v1.cpp
payloads/channel-update-v1.cpp
payloads/channel-chat-notification-v1.cpp
payloads/channel-chat-message-v1.cpp
payloads/channel-moderate-v2.cpp
# Add your new subscription type source file above this line
messages/metadata.cpp
${eventsub_generated_sources}
)
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
@@ -43,13 +52,6 @@ target_compile_definitions(${PROJECT_NAME} PUBLIC
$<$<BOOL:${MSVC}>:BOOST_CONTAINER_NO_LIB>
)
# Hack to get the include directories from Python
get_target_property(_inc_dirs ${PROJECT_NAME} INCLUDE_DIRECTORIES)
list(APPEND _inc_dirs ${Boost_INCLUDE_DIRS})
list(APPEND _inc_dirs ${OPENSSL_INCLUDE_DIR})
list(JOIN _inc_dirs ";" _inc_dir)
add_custom_target(_ast_includes echo "@@INCLUDE_DIRS=${_inc_dir}")
if (MSVC)
# Add bigobj
target_compile_options(${PROJECT_NAME} PRIVATE /EHsc /bigobj)