@@ -81,10 +81,19 @@ endif
81
81
threads_dep = dependency (' threads' )
82
82
maths_dep = compiler.find_library (' m' , required : false )
83
83
84
+ # Not sure why Meson doesn't support a way to append include directories :/
85
+ if host_machine .system() == ' windows'
84
86
inc = include_directories (
85
87
' src' ,
88
+ ' src/win32' ,
86
89
' src/imgui' ,
87
90
' src/UnityPluginAPI' )
91
+ else
92
+ inc = include_directories (
93
+ ' src' ,
94
+ ' src/imgui' ,
95
+ ' src/UnityPluginAPI' )
96
+ endif
88
97
89
98
dlib_sp = subproject (' dlib' )
90
99
dlib_dep = dlib_sp.get_variable (' dlib_dep' )
@@ -155,17 +164,28 @@ if not freenect_dep.found()
155
164
endif
156
165
client_api_defines += [ ' -DUSE_FREENECT' ]
157
166
158
- glfw_dep = dependency (' glfw3' , required : false )
167
+ glfw_dep = dependency (' glfw3' , fallback : [ ' glfw ' , ' glfw_dep ' ], required : false )
159
168
snappy_dep = dependency (' snappy' , required : false )
160
169
161
170
imgui_src = [
162
171
' src/imgui/imgui.cpp' ,
163
172
' src/imgui/imgui_demo.cpp' ,
164
173
' src/imgui/imgui_draw.cpp' ,
174
+ ' src/imgui/imgui_widgets.cpp' ,
165
175
' src/imgui/profiler.cpp' ,
166
176
' src/imgui/timer.cpp' ,
167
177
]
168
178
179
+ if host_machine .system() == ' windows'
180
+ getopt_src = [ ' src/getopt-compat.c' ]
181
+ getline_src = [ ' src/getline-compat.c' ]
182
+ basename_src = [ ' src/basename-compat.c' ]
183
+ else
184
+ getopt_src = []
185
+ getline_src = []
186
+ basename_src = []
187
+ endif
188
+
169
189
client_api_src = [
170
190
' src/glimpse_properties.cc' ,
171
191
' src/glimpse_context.cc' ,
@@ -177,6 +197,8 @@ client_api_src = [
177
197
' src/glimpse_log.c' ,
178
198
' src/glimpse_gl.c' ,
179
199
' src/glimpse_target.cc' ,
200
+ ' src/glimpse_mutex.c' ,
201
+ ' src/glimpse_os.c' ,
180
202
181
203
' src/infer_labels.cc' ,
182
204
' src/joints_inferrer.cc' ,
@@ -188,7 +210,7 @@ client_api_src = [
188
210
189
211
' src/tinyexr.cc' ,
190
212
' src/parson.c' ,
191
- ]
213
+ ] + basename_src + getline_src
192
214
193
215
client_api_deps = [
194
216
glm_dep,
@@ -328,7 +350,10 @@ if platform_android == true
328
350
glfm_dep = glfm_sp.get_variable (' glfm_dep' )
329
351
330
352
viewer_deps = client_api_deps + [ glfm_dep ]
331
- viewer_defines = client_api_defines + [ ' -DUSE_GLFM' ]
353
+ viewer_defines = client_api_defines + [
354
+ ' -DUSE_GLFM' ,
355
+ ' -DIMGUI_IMPL_OPENGL_LOADER_CUSTOM=<epoxy/gl.h>'
356
+ ]
332
357
333
358
if tango_enabled
334
359
viewer_deps += tango_deps
@@ -340,7 +365,8 @@ if platform_android == true
340
365
viewer_defines += [ ' -DUSE_ANDROID_ASSET_MANAGER_API' ]
341
366
endif
342
367
343
- imgui_src += ' src/imgui/imgui_impl_glfm_gles3.cpp'
368
+ imgui_src += ' src/imgui/imgui_impl_glfm.cpp'
369
+ imgui_src += ' src/imgui/imgui_impl_opengl3.cpp'
344
370
345
371
android_viewer = shared_library (' glimpse_viewer_android' ,
346
372
[ ' src/glimpse_viewer.cc' ] + client_api_src + imgui_src,
@@ -359,9 +385,13 @@ if platform_ios == true
359
385
glfm_dep = glfm_sp.get_variable (' glfm_dep' )
360
386
361
387
viewer_deps = client_api_deps + [ glfm_dep ]
362
- viewer_defines = client_api_defines + [ ' -DUSE_GLFM' ]
388
+ viewer_defines = client_api_defines + [
389
+ ' -DUSE_GLFM' ,
390
+ ' -DIMGUI_IMPL_OPENGL_LOADER_CUSTOM=<epoxy/gl.h>'
391
+ ]
363
392
364
- imgui_src += ' src/imgui/imgui_impl_glfm_gles3.cpp'
393
+ imgui_src += ' src/imgui/imgui_impl_glfm.cpp'
394
+ imgui_src += ' src/imgui/imgui_impl_opengl3.cpp'
365
395
366
396
executable (' glimpse_viewer' ,
367
397
[ ' src/glimpse_viewer.cc' , ' src/ios_utils.m' ] + client_api_src + imgui_src,
@@ -379,14 +409,24 @@ if platform_ios == true
379
409
])
380
410
endif
381
411
382
- if not meson .is_cross_build()
412
+ if (
413
+ #host_machine.system() == 'windows' or
414
+ host_machine .system() == ' linux' or
415
+ (host_machine .system() == ' darwin' and platform_ios == false ))
416
+ is_development_platform = true
417
+ else
418
+ is_development_platform = false
419
+ endif
420
+
421
+ if is_development_platform
383
422
384
423
executable (' image-pre-processor' ,
385
424
[ ' src/image-pre-processor.cc' ,
386
425
' src/tinyexr.cc' ,
387
426
' src/parson.c' ,
388
427
' src/perlin.c' ,
389
428
' src/glimpse_log.c' ,
429
+ ' src/glimpse_mutex.c' ,
390
430
' src/glimpse_properties.cc' ,
391
431
' src/glimpse_data.cc' ,
392
432
' src/image_utils.cc' ,
@@ -399,22 +439,24 @@ executable('train_rdt',
399
439
[ ' src/train_rdt.c' ,
400
440
' src/glimpse_rdt.cc' ,
401
441
' src/glimpse_log.c' ,
442
+ ' src/glimpse_mutex.c' ,
402
443
' src/glimpse_properties.cc' ,
403
444
' src/glimpse_data.cc' ,
404
445
' src/image_utils.cc' ,
405
446
' src/rdt_tree.cc' ,
406
447
' src/tinyexr.cc' ,
407
448
' src/parson.c' ,
408
449
' src/llist.c' ,
409
- ' src/xalloc.c' ,
410
- ' src/pthread_barrier/pthread_barrier.c ' ],
450
+ ' src/xalloc.c'
451
+ ],
411
452
include_directories : inc,
412
453
dependencies : [ libpng_dep, threads_dep ])
413
454
414
455
executable (' test_rdt' ,
415
456
[ ' src/test_rdt.cc' ,
416
457
' src/glimpse_rdt.cc' ,
417
458
' src/glimpse_log.c' ,
459
+ ' src/glimpse_mutex.c' ,
418
460
' src/glimpse_properties.cc' ,
419
461
' src/glimpse_data.cc' ,
420
462
' src/image_utils.cc' ,
@@ -430,6 +472,7 @@ executable('test_rdt',
430
472
executable (' annotate_bone_map' ,
431
473
[ ' src/annotate_bone_map.cc' ,
432
474
' src/glimpse_log.c' ,
475
+ ' src/glimpse_mutex.c' ,
433
476
' src/glimpse_data.cc' ,
434
477
' src/image_utils.cc' ,
435
478
' src/tinyexr.cc' ,
@@ -442,6 +485,7 @@ executable('annotate_bone_map',
442
485
executable (' train_joint_params' ,
443
486
[ ' src/train_joint_params.cc' ,
444
487
' src/glimpse_log.c' ,
488
+ ' src/glimpse_mutex.c' ,
445
489
' src/glimpse_data.cc' ,
446
490
' src/infer_labels.cc' ,
447
491
' src/joints_inferrer.cc' ,
@@ -458,6 +502,7 @@ executable('train_joint_params',
458
502
executable (' depth2labels' ,
459
503
[ ' src/depth2labels.cc' ,
460
504
' src/glimpse_log.c' ,
505
+ ' src/glimpse_mutex.c' ,
461
506
' src/infer_labels.cc' ,
462
507
' src/image_utils.cc' ,
463
508
' src/rdt_tree.cc' ,
@@ -483,22 +528,16 @@ executable('pfm-to-exr',
483
528
' src/tinyexr.cc' ],
484
529
include_directories : inc)
485
530
486
- executable (' json-to-rdt' ,
487
- [ ' src/json-to-rdt.c' ,
488
- ' src/glimpse_log.c' ,
489
- ' src/rdt_tree.cc' ,
490
- ' src/parson.c' ,
491
- ' src/xalloc.c' ],
492
- include_directories : inc)
493
-
494
531
executable (' jip-to-json' ,
495
532
[ ' src/jip-to-json.c' ,
496
533
' src/glimpse_log.c' ,
534
+ ' src/glimpse_mutex.c' ,
497
535
' src/jip.cc' ,
498
536
' src/parson.c' ,
499
537
' src/llist.c' ,
500
538
' src/xalloc.c' ],
501
- include_directories : inc)
539
+ include_directories : inc,
540
+ dependencies : [ threads_dep ])
502
541
503
542
executable (' pfm-debug' ,
504
543
[ ' src/pfm-debug.c' ],
@@ -507,6 +546,7 @@ executable('pfm-debug',
507
546
executable (' index-to-recording' ,
508
547
[ ' src/index-to-recording.cc' ,
509
548
' src/glimpse_log.c' ,
549
+ ' src/glimpse_mutex.c' ,
510
550
' src/glimpse_data.cc' ,
511
551
' src/image_utils.cc' ,
512
552
' src/rdt_tree.cc' ,
@@ -529,19 +569,35 @@ if snappy_dep.found()
529
569
dependencies : [ snappy_dep, libpng_dep, threads_dep ])
530
570
endif
531
571
572
+ endif # is_development_platform
573
+
574
+ executable (' json-to-rdt' ,
575
+ [ ' src/json-to-rdt.c' ,
576
+ ' src/glimpse_log.c' ,
577
+ ' src/glimpse_mutex.c' ,
578
+ ' src/rdt_tree.cc' ,
579
+ ' src/parson.c' ,
580
+ ' src/xalloc.c' ] + getopt_src,
581
+ include_directories : inc,
582
+ dependencies : [ threads_dep ])
583
+
584
+
532
585
if glfw_dep.found() and epoxy_dep.found()
533
- viewer_defines = client_api_defines + [ ' -DUSE_GLFW' ]
534
- imgui_src += ' src/imgui/imgui_impl_glfw_gles3.cpp'
586
+ viewer_defines = client_api_defines + [
587
+ ' -DUSE_GLFW' ,
588
+ ' -DGLFW_INCLUDE_NONE' ,
589
+ ' -DIMGUI_IMPL_OPENGL_LOADER_CUSTOM=<epoxy/gl.h>'
590
+ ]
591
+ imgui_src += ' src/imgui/imgui_impl_glfw.cpp'
592
+ imgui_src += ' src/imgui/imgui_impl_opengl3.cpp'
535
593
executable (' glimpse_viewer' ,
536
- [ ' src/glimpse_viewer.cc' ] + client_api_src + imgui_src,
594
+ [ ' src/glimpse_viewer.cc' ] + client_api_src + imgui_src + getopt_src ,
537
595
include_directories : inc,
538
596
dependencies : client_api_deps + [ glfw_dep ],
539
597
c_args : viewer_defines,
540
598
cpp_args : viewer_defines)
541
599
endif
542
600
543
- endif # is_cross_build
544
-
545
601
if unity_enabled
546
602
install_args = [
547
603
' --buildtype' , get_option (' buildtype' ),
0 commit comments