wxGTK ignores wxUSE_WEBREQUEST_CURL on macOS which breaks build when urlsession is unsupported (Issue #26471)

11 views
Skip to first unread message

Sergey Fedorov

unread,
May 17, 2026, 1:06:32 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed
barracuda156 created an issue (wxWidgets/wxWidgets#26471)

@vadz For some reason wxGTK 3.2.10 build violates settings for webrequest on macOS: while CMakeCache receives desired values:

//use wxWebRequest class
wxUSE_WEBREQUEST:BOOL=ON

//use wxWebRequest libcurl backend
wxUSE_WEBREQUEST_CURL:BOOL=ON

//use wxWebRequest URLSession backend
wxUSE_WEBREQUEST_URLSESSION:BOOL=OFF

the build proceeds to try building urlsession sources regardless (which fails, of course, on older macOS):

:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:27:69: error: cannot find protocol declaration for 'NSURLSessionDataDelegate'
:info:build    27 | @interface wxWebSessionDelegate : NSObject <NSURLSessionDataDelegate>
:info:build       |                                                                     ^
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm: In function '-[wxWebSessionDelegate initWithSession:]':
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:40:58: warning: 'NSMapTable' may not respond to '+weakToStrongObjectsMapTable'
:info:build    40 |     m_requests = [[NSMapTable weakToStrongObjectsMapTable] retain];
:info:build       |                                                          ^
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:40:58: warning: (messages without a matching method signature will be assumed to return 'id' and accept '...' as arguments)
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm: At global scope:
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:65:54: error: 'NSURLSessionDataTask' does not name a type; did you mean 'NSURLSessionTask'?
:info:build    65 | - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data
:info:build       |                                                      ^~~~~~~~~~~~~~~~~~~~
:info:build       |                                                      NSURLSessionTask
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:106:32: error: expected ')' before '(' token
:info:build   106 |         completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
:info:build       |                           ~    ^~
:info:build       |                                )
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:106:33: error: expected identifier before '(' token
:info:build   106 |         completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
:info:build       |                                 ^
:info:build [address=20696e80 pc=00178bdc]
:info:build /opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/wxWidgets-3.2.10/src/osx/webrequest_urlsession.mm:106: confused by earlier errors, bailing out
:info:build make[2]: *** [libs/net/CMakeFiles/wxnet.dir/__/__/__/__/src/osx/webrequest_urlsession.mm.o] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/wxgtk-3.2-82c94e45/work/build'
:info:build make[1]: *** [libs/net/CMakeFiles/wxnet.dir/all] Error 2
:info:build make[1]: *** Waiting for unfinished jobs....


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26471@github.com>

VZ

unread,
May 17, 2026, 2:48:51 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26471)

This is because we have

#ifdef __APPLE__
#define wxUSE_WEBREQUEST_URLSESSION wxUSE_WEBREQUEST
#else
#cmakedefine01 wxUSE_WEBREQUEST_URLSESSION
#endif

in build/cmake/setup.h.in so as soon as you enable Curl backend, this one gets enabled too.

I think we should just remove the __APPLE__ part, CMake should always define the variable correctly. For the other setup.h copies I'm less sure, however, as we could have a problem in builds using non-generated setup.h, e.g. with Xcode.

See also 181be12 (Simplify wxUSE_WEBREQUEST_XXX logic, 2020-12-13).


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26471/4472148456@github.com>

VZ

unread,
May 17, 2026, 3:11:59 PM (2 days ago) May 17
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#26471)

Last commit from #26473 should fix this.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/26471/4472200701@github.com>

Reply all
Reply to author
Forward
0 new messages