@@ -203,18 +203,88 @@ subdir('test')
203203
204204exec_tgts = []
205205
206+ make_header = find_program (' scripts/make_header.sh' )
207+
208+ onebinary_stuff = []
209+ onebinary_stuff += ' MistOutRTMP'
210+ onebinary_stuff += ' MistOutHLS'
211+ onebinary_stuff += ' MistOutHTTP'
212+ onebinary_stuff += ' MistInBuffer'
213+
214+ onebinary_tgts = []
215+
206216## This makes sure all (installable) executables are build in top level directory
207217## Done because MistController expects its binaries to all be in the same directory
208218foreach exec : executables
209- exec_tgts + = executable (
219+ my_exec = executable (
210220 exec.get(' name' ),
211221 exec.get(' sources' ),
212222 dependencies : exec.get(' deps' ),
213223 cpp_args : exec.get(' defines' ),
214224 install : true ,
215225 )
226+ exec_tgts += my_exec
227+ gen_src_name = exec.get(' name' ) + ' .json'
228+ gen_src = custom_target (gen_src_name,
229+ input : [my_exec],
230+ output : [exec.get(' name' ) + ' .json' ],
231+ command : [make_header, ' @INPUT@' , ' @OUTPUT0@' ]
232+ )
233+ if onebinary_stuff.contains(exec.get(' name' ))
234+ onebinary_tgts += gen_src
235+ endif
216236endforeach
217237
238+ prog_python = find_program (' python3' )
239+
240+ onebinary_header = custom_target (' onebinary' ,
241+ input : [onebinary_tgts],
242+ output : [' controller_static_capabilities.cpp' ],
243+ command : [prog_python, ' ../scripts/onebinary_gen.py' , ' --cap-header' , ' @OUTPUT0@' , ' --entrypoint' , ' foo.cpp' , ' @INPUT@' ],
244+ depends : [onebinary_tgts]
245+ )
246+
247+ onebinary = executable (
248+ ' MistServer' ,
249+ [
250+ files (
251+ ' src/mistserver.cpp' ,
252+ ' src/input/input.cpp' ,
253+ ' src/input/input_buffer.cpp' ,
254+ ' src/output/output.cpp' ,
255+ ' src/output/output_hls.cpp' ,
256+ ' src/output/output_http.cpp' ,
257+ ' src/output/output_http_internal.cpp' ,
258+ ' src/output/output_ts.cpp' ,
259+ ' src/output/output_ts_base.cpp' ,
260+ ' src/output/output_rtmp.cpp' ,
261+ ' src/controller/controller_external_writers.cpp' ,
262+ ' src/controller/controller_updater.cpp' ,
263+ ' src/controller/controller_streams.cpp' ,
264+ ' src/controller/controller_storage.cpp' ,
265+ ' src/controller/controller_connectors.cpp' ,
266+ ' src/controller/controller_statistics.cpp' ,
267+ ' src/controller/controller_limits.cpp' ,
268+ ' src/controller/controller_capabilities.cpp' ,
269+ ' src/controller/controller_uplink.cpp' ,
270+ ' src/controller/controller_api.cpp' ,
271+ ' src/controller/controller_push.cpp' ,
272+ ' src/controller/controller_variables.cpp' ,
273+ ),
274+ io_cpp,
275+ header_tgts,
276+ embed_tgts,
277+ server_html,
278+ onebinary_header,
279+ ],
280+ cpp_args : [
281+ ' -DTS_BASECLASS=HTTPOutput' ,
282+ ' -DONE_BINARY=1' ,
283+ ],
284+ dependencies : [libmist_dep],
285+ install : true ,
286+ )
287+
218288# Docs
219289doxygen = find_program (' doxygen' , required : false )
220290if doxygen.found()
0 commit comments