Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 31a8ee3

Browse files
authored
feat: add PS SDK transport support (#1262)
* feat: allow downstream SDKs to implement custom transport * add "pshttp" support to the list of supported ones
1 parent fc6a314 commit 31a8ee3

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

CMakeLists.txt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
5353
set(LINUX TRUE)
5454
elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400")
5555
set(AIX TRUE)
56+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Prospero")
57+
set(PROSPERO TRUE)
5658
endif()
5759

5860
#setup sentry library type
@@ -117,28 +119,39 @@ endif()
117119

118120
if(WIN32)
119121
set(SENTRY_DEFAULT_TRANSPORT "winhttp")
122+
set(_SUPPORTED_TRANSPORTS "none, winhttp")
123+
elseif(PROSPERO)
124+
set(SENTRY_DEFAULT_TRANSPORT "pshttp")
125+
set(_SUPPORTED_TRANSPORTS "none, pshttp")
120126
elseif((APPLE AND NOT IOS) OR LINUX OR AIX OR NX)
121127
set(SENTRY_DEFAULT_TRANSPORT "curl")
128+
set(_SUPPORTED_TRANSPORTS "none, curl")
122129
else()
123130
set(SENTRY_DEFAULT_TRANSPORT "none")
131+
set(_SUPPORTED_TRANSPORTS "none, curl, or winhttp on Windows")
124132
endif()
125133

126134
set(SENTRY_TRANSPORT ${SENTRY_DEFAULT_TRANSPORT} CACHE STRING
127-
"The HTTP transport that sentry uses to submit events to the sentry server, can be either 'none', 'curl' or 'winhttp' on windows.")
135+
"The HTTP transport that sentry uses to submit events to the sentry server, can be one of: ${_SUPPORTED_TRANSPORTS}.")
128136

129137
if(SENTRY_TRANSPORT STREQUAL "winhttp")
130138
set(SENTRY_TRANSPORT_WINHTTP TRUE)
139+
if(NOT WIN32)
140+
message(FATAL_ERROR "The winhttp transport is only supported on Windows.")
141+
endif()
131142
elseif(SENTRY_TRANSPORT STREQUAL "curl")
132143
set(SENTRY_TRANSPORT_CURL TRUE)
133144
elseif(SENTRY_TRANSPORT STREQUAL "none")
134145
set(SENTRY_TRANSPORT_NONE TRUE)
146+
elseif(SENTRY_TRANSPORT STREQUAL "pshttp")
147+
# Not implemented here, but in the downstream SDK
148+
if(NOT PROSPERO)
149+
message(FATAL_ERROR "The pshttp transport is only supported on PlayStation.")
150+
endif()
135151
else()
136-
message(FATAL_ERROR "SENTRY_TRANSPORT must be one of 'none', 'curl' or 'winhttp'")
152+
message(FATAL_ERROR "SENTRY_TRANSPORT must be one of: ${_SUPPORTED_TRANSPORTS}")
137153
endif()
138154

139-
if(SENTRY_TRANSPORT_WINHTTP AND NOT WIN32)
140-
message(FATAL_ERROR "The winhttp transport is only supported on Windows.")
141-
endif()
142155

143156
if(SENTRY_BUILD_TESTS OR SENTRY_BUILD_EXAMPLES)
144157
enable_testing()

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if(WIN32)
6363
path/sentry_path_windows.c
6464
symbolizer/sentry_symbolizer_windows.c
6565
)
66-
elseif(NX OR CMAKE_SYSTEM_NAME STREQUAL "Prospero")
66+
elseif(NX OR PROSPERO)
6767
sentry_target_sources_cwd(sentry
6868
sentry_unix_spinlock.h
6969
path/sentry_path_unix.c

0 commit comments

Comments
 (0)