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(
1616 meson_version : ' >=0.62.0'
1717)
1818
19+ cxx = meson .get_compiler(' cpp' )
20+
1921# Check just in case downstream decides to edit the source
2022# and add a project version
2123version = meson .project_version()
2224if version == ' undefined'
23- cxx = meson .get_compiler(' cpp' )
2425 version = cxx.get_define(' CPPHTTPLIB_VERSION' ,
2526 prefix : ' #include <httplib.h>' ,
2627 include_directories : include_directories (' .' )).strip(' "' )
2728 assert (version != '' , ' failed to get version from httplib.h' )
2829endif
2930
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+
3039deps = [dependency (' threads' )]
3140args = []
3241
You can’t perform that action at this time.
0 commit comments