@@ -6,109 +6,13 @@ project(
66 meson_version : ' >=0.54.1' ,
77)
88
9+ cstd = ' c_std=gnu99'
10+
911cc = meson .get_compiler(' c' )
1012if cc.get_argument_syntax() == ' msvc'
1113 error (' MSVC is unsupported. Requires custom pthread library' )
1214endif
1315
14- libupnp_incdir = include_directories (
15- ' .' ,
16- ' upnp/inc' ,
17- ' upnp/src/inc' ,
18- ' upnp/src/threadutil' ,
19- )
20- libixml_incdir = include_directories (' ixml/inc' , ' ixml/src/inc' )
21-
22- libixml = static_library (
23- ' ixml' ,
24- ' ixml/src/attr.c' ,
25- ' ixml/src/document.c' ,
26- ' ixml/src/element.c' ,
27- ' ixml/src/ixml.c' ,
28- ' ixml/src/ixmldebug.c' ,
29- ' ixml/src/ixmlmembuf.c' ,
30- ' ixml/src/ixmlparser.c' ,
31- ' ixml/src/namedNodeMap.c' ,
32- ' ixml/src/node.c' ,
33- ' ixml/src/nodeList.c' ,
34- include_directories : [libixml_incdir, libupnp_incdir],
35- pic : true ,
36- )
37-
38- upnp_sources = files (
39- ' upnp/src/api/UpnpActionComplete.c' ,
40- ' upnp/src/api/UpnpActionRequest.c' ,
41- ' upnp/src/api/UpnpDiscovery.c' ,
42- ' upnp/src/api/UpnpEvent.c' ,
43- ' upnp/src/api/UpnpEventSubscribe.c' ,
44- ' upnp/src/api/UpnpExtraHeaders.c' ,
45- ' upnp/src/api/UpnpFileInfo.c' ,
46- ' upnp/src/api/UpnpStateVarComplete.c' ,
47- ' upnp/src/api/UpnpStateVarRequest.c' ,
48- ' upnp/src/api/UpnpString.c' ,
49- ' upnp/src/api/UpnpSubscriptionRequest.c' ,
50- ' upnp/src/api/upnpapi.c' ,
51- ' upnp/src/api/upnpdebug.c' ,
52- ' upnp/src/genlib/client_table/GenlibClientSubscription.c' ,
53- ' upnp/src/genlib/client_table/client_table.c' ,
54- ' upnp/src/genlib/miniserver/miniserver.c' ,
55- ' upnp/src/genlib/net/http/httpparser.c' ,
56- ' upnp/src/genlib/net/http/httpreadwrite.c' ,
57- ' upnp/src/genlib/net/http/parsetools.c' ,
58- ' upnp/src/genlib/net/http/statcodes.c' ,
59- ' upnp/src/genlib/net/http/webserver.c' ,
60- ' upnp/src/genlib/net/sock.c' ,
61- ' upnp/src/genlib/net/uri/uri.c' ,
62- ' upnp/src/genlib/service_table/service_table.c' ,
63- ' upnp/src/genlib/util/list.c' ,
64- ' upnp/src/genlib/util/membuffer.c' ,
65- ' upnp/src/genlib/util/strintmap.c' ,
66- ' upnp/src/genlib/util/util.c' ,
67- ' upnp/src/threadutil/FreeList.c' ,
68- ' upnp/src/threadutil/LinkedList.c' ,
69- ' upnp/src/threadutil/ThreadPool.c' ,
70- ' upnp/src/threadutil/TimerThread.c' ,
71- ' upnp/src/urlconfig/urlconfig.c' ,
72- )
73-
74- if get_option (' gena' ) or get_option (' optssdp' )
75- upnp_sources += files (
76- ' upnp/src/uuid/md5.c' ,
77- ' upnp/src/uuid/sysdep.c' ,
78- ' upnp/src/uuid/uuid.c' ,
79- )
80- endif
81-
82- if get_option (' gena' )
83- upnp_sources += files (
84- ' upnp/src/gena/gena_callback2.c' ,
85- ' upnp/src/gena/gena_ctrlpt.c' ,
86- ' upnp/src/gena/gena_device.c' ,
87- )
88- endif
89-
90- if get_option (' soap' )
91- upnp_sources += files (
92- ' upnp/src/soap/soap_common.c' ,
93- ' upnp/src/soap/soap_ctrlpt.c' ,
94- ' upnp/src/soap/soap_device.c' ,
95- )
96- endif
97-
98- if get_option (' ssdp' )
99- upnp_sources += files (
100- ' upnp/src/ssdp/SSDPResultData.c' ,
101- ' upnp/src/ssdp/SSDPResultDataCallback.c' ,
102- ' upnp/src/ssdp/ssdp_ctrlpt.c' ,
103- ' upnp/src/ssdp/ssdp_device.c' ,
104- ' upnp/src/ssdp/ssdp_server.c' ,
105- )
106- endif
107-
108- if get_option (' tools' )
109- upnp_sources += files (' upnp/src/api/upnptools.c' )
110- endif
111-
11216ver = meson .project_version().split(' .' )
11317uconf = configuration_data ()
11418uconf.set(' IXML_HAVE_SCRIPTSUPPORT' , true )
@@ -184,24 +88,6 @@ deps += dependency(
18488 ' libcrypto' ,
18589 required : get_option (' open_ssl' ),
18690)
187- threads_dep = dependency (' threads' )
188-
189- libupnp = library (
190- ' upnp' ,
191- upnp_sources,
192- include_directories : [libixml_incdir, libupnp_incdir],
193- dependencies : [deps, threads_dep],
194- link_with : libixml,
195- install : true ,
196- version : ' 17.2.4' ,
197- )
198-
199- pkg = import (' pkgconfig' )
200- pkg.generate(
201- libupnp,
202- name : ' libupnp' ,
203- subdirs : ' upnp' ,
204- )
20591
20692headers = files (
20793 ' ixml/inc/ixml.h' ,
@@ -238,10 +124,12 @@ install_headers(
238124 subdir : ' upnp' ,
239125)
240126
241- libupnp_dep = declare_dependency (
242- include_directories : [libixml_incdir, libupnp_incdir],
243- link_with : libupnp,
244- )
127+ libupnp_incdir = include_directories (' .' , ' ixml/inc' , ' upnp/inc' )
128+ depinc = include_directories (' ixml/inc' , ' upnp/inc' )
129+ threads_dep = dependency (' threads' )
130+
131+ subdir (' ixml' )
132+ subdir (' upnp' )
245133
246134if get_option (' samples' ) and get_option (' tools' )
247135 sample_conf = configuration_data ()
@@ -260,6 +148,7 @@ if get_option('samples') and get_option('tools')
260148 ' upnp/sample/linux/tv_ctrlpt_main.c' ,
261149 include_directories : toolinc,
262150 dependencies : [libupnp_dep, threads_dep],
151+ override_options : cstd,
263152 install : true ,
264153 )
265154 endif
@@ -273,6 +162,7 @@ if get_option('samples') and get_option('tools')
273162 ' upnp/sample/linux/tv_combo_main.c' ,
274163 include_directories : toolinc,
275164 dependencies : [libupnp_dep, threads_dep],
165+ override_options : cstd,
276166 install : true ,
277167 )
278168 endif
@@ -285,6 +175,7 @@ if get_option('samples') and get_option('tools')
285175 ' upnp/sample/linux/tv_device_main.c' ,
286176 include_directories : toolinc,
287177 dependencies : [libupnp_dep, threads_dep],
178+ override_options : cstd,
288179 install : true ,
289180 )
290181
0 commit comments