File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -16,17 +16,26 @@ project(
16
16
meson_version : ' >=0.62.0'
17
17
)
18
18
19
+ cxx = meson .get_compiler(' cpp' )
20
+
19
21
# Check just in case downstream decides to edit the source
20
22
# and add a project version
21
23
version = meson .project_version()
22
24
if version == ' undefined'
23
- cxx = meson .get_compiler(' cpp' )
24
25
version = cxx.get_define(' CPPHTTPLIB_VERSION' ,
25
26
prefix : ' #include <httplib.h>' ,
26
27
include_directories : include_directories (' .' )).strip(' "' )
27
28
assert (version != '' , ' failed to get version from httplib.h' )
28
29
endif
29
30
31
+ if cxx.has_function(' poll' , prefix : ' #include <poll.h>' )
32
+ # Use poll if present
33
+ add_project_arguments (' -DCPPHTTPLIB_USE_POLL' , language : ' cpp' )
34
+ else if cxx.has_function(' select' , prefix : ' #include <sys/select.h>' )
35
+ # Use select otherwise
36
+ add_project_arguments (' -DCPPHTTPLIB_USE_SELECT' , language : ' cpp' )
37
+ endif
38
+
30
39
deps = [dependency (' threads' )]
31
40
args = []
32
41
You can’t perform that action at this time.
0 commit comments