-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
settings.bzl
645 lines (641 loc) · 23.6 KB
/
settings.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# This file contains configuration settings for how Drake should configure its
# private build of VTK.
#
# Each key in the MODULE_SETTINGS dict provides the settings for the VTK module
# of that name. If a module does not need any settings beyond the defaults, it
# can be omitted from the dict.
#
# The kinds of settings available for a module are documented in rules.bzl on
# the vtk_cc_module() rule.
MODULE_SETTINGS = {
# First, we'll configure VTK's first-party utility libraries.
"ABI": {
"cmake_defines": [
"VTK_ABI_NAMESPACE_BEGIN=inline namespace drake_vendor __attribute__ ((visibility (\"hidden\"))) {", # noqa
"VTK_ABI_NAMESPACE_END=}",
],
},
"VTK::kwiml": {
"cmake_defines": [
# Match the Utilities/KWIML/vtkkwiml/CMakeLists.txt value. (This
# version number hasn't changed in 8+ years, so we won't bother
# automating it.)
"KWIML_VERSION=1.0.0",
"KWIML_VERSION_DECIMAL=1000000",
],
},
"VTK::vtksys": {
# Upstream, this module has opt-in flags for each small feature within
# the module. The VTK CMake script chooses which features to enable. To
# match that logic here, we'll opt-out the default srcs glob and opt-in
# to specific files that match how upstream VTK configures KWSys (with
# exceptions noted inline below).
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Utilities/KWSys/vtksys/Base64.c",
# CommandLineArguments.cxx is unused in Drake, so is omitted here.
"Utilities/KWSys/vtksys/Directory.cxx",
"Utilities/KWSys/vtksys/DynamicLoader.cxx",
"Utilities/KWSys/vtksys/EncodingC.c",
"Utilities/KWSys/vtksys/EncodingCXX.cxx",
"Utilities/KWSys/vtksys/FStream.cxx",
# Glob.cxx is unused in Drake, so is omitted here.
"Utilities/KWSys/vtksys/MD5.c",
"Utilities/KWSys/vtksys/ProcessUNIX.c",
"Utilities/KWSys/vtksys/RegularExpression.cxx",
"Utilities/KWSys/vtksys/String.c",
"Utilities/KWSys/vtksys/Status.cxx",
"Utilities/KWSys/vtksys/System.c",
"Utilities/KWSys/vtksys/SystemInformation.cxx",
"Utilities/KWSys/vtksys/SystemTools.cxx",
],
"cmake_defines": [
# Match the VTK defaults.
"KWSYS_NAMESPACE=vtksys",
"KWSYS_NAME_IS_KWSYS=0",
"KWSYS_SYSTEMTOOLS_USE_TRANSLATION_MAP=1",
# Features that are available on the host platform.
"KWSYS_STL_HAS_WSTRING=1",
# Features that are NOT available on the host platform.
"KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H=0",
# The *module* prefix and suffix are the same on Linux and macOS.
# https://gitlab.kitware.com/cmake/cmake/-/issues/21189
"KWSYS_DynamicLoader_PREFIX=lib",
"KWSYS_DynamicLoader_SUFFIX=.so",
# Library API choices.
"KWSYS_BUILD_SHARED=0",
],
"copts_extra": [
# Match the VTK defaults.
"-DKWSYS_NAMESPACE=vtksys",
# Features that are available on the host platform.
"-DKWSYS_SYS_HAS_IFADDRS_H",
"-DKWSYS_CXX_HAS_SETENV",
"-DKWSYS_CXX_HAS_UNSETENV",
"-DKWSYS_CXX_HAS_UTIMENSAT",
] + select({
":osx": [
"-DKWSYS_CXX_STAT_HAS_ST_MTIMESPEC",
],
"//conditions:default": [
"-DKWSYS_CXX_STAT_HAS_ST_MTIM",
],
}),
},
# Second, we'll configure the modules Drake needs (in alphabetical order).
"VTK::CommonColor": {
# This isn't used directly by Drake, but is used by other VTK modules.
},
"VTK::CommonComputationalGeometry": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Common/ComputationalGeometry/vtkKochanekSpline.cxx",
],
},
"VTK::CommonCore": {
"visibility": ["//visibility:public"],
"hdrs_glob_exclude": [
# These header files are consumed by bespoke configure_file logic,
# so we don't want to automatically configure them. Instead, we'll
# use generate_common_core_sources() from rules.bzl to handle it.
"Common/Core/vtkArrayDispatchArrayList.h.in",
"Common/Core/vtkTypeListMacros.h.in",
"Common/Core/vtkTypedArray.h.in",
],
"hdrs_extra": [
# These are the hdrs outputs of generate_common_core_sources() from
# rules.bzl (related to the hdrs_glob_exclude, immediately above).
":common_core_array_dispatch_array_list",
":common_core_type_list_macros",
":common_core_vtk_type_arrays_hdrs",
],
"included_cxxs": [
"Common/Core/vtkMersenneTwister_Private.cxx",
"Common/Core/vtkVariantToNumeric.cxx",
],
"srcs_extra": [
# Sources in nested subdirs are not globbed by default, so we need
# to list the nested sources we want explicitly.
"Common/Core/SMP/Common/vtkSMPToolsAPI.cxx",
"Common/Core/SMP/Sequential/vtkSMPToolsImpl.cxx",
# These header files are generated by custom configure_file logic.
# See generate_common_core_sources() in rules.bzl.
":common_core_array_instantiations",
":common_core_vtk_type_arrays_srcs",
],
"srcs_glob_exclude": [
# Optional files that we choose not to enable.
"Common/Core/vtkAndroid*",
"Common/Core/vtkWin32*",
],
"cmake_defines_cmakelists": [
# Scrape the VTK_..._VERSION definitions from this file.
"CMake/vtkVersion.cmake",
],
"cmake_defines": [
# Features that are available on the host platform.
"VTK_HAS_ISFINITE=1",
"VTK_HAS_ISINF=1",
"VTK_HAS_ISNAN=1",
"VTK_HAS_STD_ISFINITE=1",
"VTK_HAS_STD_ISINF=1",
"VTK_HAS_STD_ISNAN=1",
"VTK_USE_64BIT_IDS=1",
"VTK_USE_64BIT_TIMESTAMPS=1",
# Threading.
"VTK_MAX_THREADS=1",
"VTK_SMP_DEFAULT_IMPLEMENTATION_SEQUENTIAL=1",
"VTK_SMP_ENABLE_SEQUENTIAL=1",
"VTK_SMP_IMPLEMENTATION_TYPE=Sequential",
"VTK_USE_PTHREADS=1",
# Library API choices.
"VTK_ALL_NEW_OBJECT_FACTORY=1",
"VTK_ALWAYS_OPTIMIZE_ARRAY_ITERATORS=1",
"VTK_LEGACY_REMOVE=1",
"VTK_USE_FUTURE_CONST=1",
"VTK_WARN_ON_DISPATCH_FAILURE=1",
],
"cmake_undefines": [
# Features that are NOT available on the host platform.
"VTK_HAS_FEENABLEEXCEPT",
"VTK_HAS_FINITE",
"VTK_HAS__FINITE",
"VTK_HAS__ISNAN",
"VTK_REQUIRE_LARGE_FILE_SUPPORT",
# All of Drake's supported CPUs are little-endian. If we ever do
# need to support, this we can patch the header file to always
# use the built-in __BIG_ENDIAN__ (instead of only on macOS).
"VTK_WORDS_BIGENDIAN",
# Threading.
"VTK_SMP_DEFAULT_IMPLEMENTATION_OPENMP",
"VTK_SMP_DEFAULT_IMPLEMENTATION_STDTHREAD",
"VTK_SMP_DEFAULT_IMPLEMENTATION_TBB",
"VTK_SMP_ENABLE_OPENMP",
"VTK_SMP_ENABLE_STDTHREAD",
"VTK_SMP_ENABLE_TBB",
"VTK_USE_WIN32_THREADS",
# Library API choices.
"VTK_BUILD_SHARED_LIBS",
"VTK_DEBUG_LEAKS",
"VTK_DEBUG_RANGE_ITERATORS",
"VTK_LEGACY_SILENT",
"VTK_USE_MEMKIND",
"VTK_USE_SCALED_SOA_ARRAYS",
],
# Allow a circular dependency between CommonCore <=> CommonDataModel.
# See also patches/common_core_vs_data_model_cycle.patch.
"copts_extra": [
"-DvtkCommonDataModel_ENABLED",
],
"deps_extra": [
":VTK__CommonDataModel_vtkDataObject",
],
},
"VTK::CommonDataModel": {
"visibility": ["//visibility:public"],
},
"VTK::CommonExecutionModel": {
"visibility": ["//visibility:public"],
},
"VTK::CommonMath": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Common/Math/vtkFunctionSet.cxx",
"Common/Math/vtkMatrix3x3.cxx",
"Common/Math/vtkMatrix4x4.cxx",
"Common/Math/vtkQuaternionInterpolator.cxx",
],
"module_deps_ignore": [
"VTK::kissfft",
],
},
"VTK::CommonMisc": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Common/Misc/vtkContourValues.cxx",
"Common/Misc/vtkErrorCode.cxx",
"Common/Misc/vtkHeap.cxx",
],
"module_deps_ignore": [
"VTK::exprtk",
],
},
"VTK::CommonSystem": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Common/System/vtkDirectory.cxx",
"Common/System/vtkTimerLog.cxx",
],
},
"VTK::CommonTransforms": {
"visibility": ["//visibility:public"],
},
"VTK::FiltersCore": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Filters/Core/vtkAppendPolyData.cxx",
"Filters/Core/vtkDecimatePro.cxx",
"Filters/Core/vtkGlyph3D.cxx",
"Filters/Core/vtkPolyDataNormals.cxx",
"Filters/Core/vtkPolyDataTangents.cxx",
"Filters/Core/vtkTriangleFilter.cxx",
],
},
"VTK::FiltersGeneral": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Filters/General/vtkExtractSelectedFrustum.cxx",
"Filters/General/vtkExtractSelectionBase.cxx",
"Filters/General/vtkGraphToPoints.cxx",
"Filters/General/vtkIconGlyphFilter.cxx",
"Filters/General/vtkImageDataToPointSet.cxx",
"Filters/General/vtkRectilinearGridToPointSet.cxx",
"Filters/General/vtkSphericalHarmonics.cxx",
"Filters/General/vtkTransformFilter.cxx",
"Filters/General/vtkTransformPolyDataFilter.cxx",
"Filters/General/vtkVertexGlyphFilter.cxx",
],
},
"VTK::FiltersGeometry": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Filters/Geometry/vtkDataSetSurfaceFilter.cxx",
"Filters/Geometry/vtkGeometryFilter.cxx",
"Filters/Geometry/vtkRectilinearGridGeometryFilter.cxx",
"Filters/Geometry/vtkStructuredGridGeometryFilter.cxx",
"Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx",
],
},
"VTK::FiltersHybrid": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Filters/Hybrid/vtkWeightedTransformFilter.cxx",
],
"included_cxxs": [
"Filters/Hybrid/vtkEarthSourceData.cxx",
],
"module_deps_ignore": [
"VTK::ImagingSources",
],
},
"VTK::FiltersSources": {
"visibility": ["//visibility:public"],
"srcs_glob_exclude": [
# Avoid the use of VTK::CommonComputationalGeometry.
"**/vtkPartitionedDataSetCollectionSource.cxx",
"**/vtkPartitionedDataSetSource.cxx",
],
},
"VTK::IOCore": {
"srcs_glob_exclude": [
# Skip code we don't need.
"**/*Codec*",
"**/*Glob*",
"**/*Particle*",
"**/*Java*",
"**/*UTF*",
# Skip this to avoid a dependency on lz4.
"**/*LZ4*",
# Skip this to avoid a dependency on lzma.
"**/*LZMA*",
],
"module_deps_ignore": [
"VTK::lz4",
"VTK::lzma",
],
},
"VTK::IOExport": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"IO/Export/vtkExporter.cxx",
"IO/Export/vtkGLTFExporter.cxx",
],
"module_deps_ignore": [
"VTK::DomainsChemistry",
"VTK::FiltersCore",
"VTK::FiltersGeometry",
"VTK::IOImage",
"VTK::IOXML",
"VTK::ImagingCore",
"VTK::RenderingContext2D",
"VTK::RenderingFreeType",
"VTK::RenderingVtkJS",
"VTK::libharu",
],
},
"VTK::IOGeometry": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"IO/Geometry/vtkGLTFDocumentLoader.cxx",
"IO/Geometry/vtkGLTFDocumentLoaderInternals.cxx",
"IO/Geometry/vtkGLTFReader.cxx",
"IO/Geometry/vtkGLTFUtils.cxx",
"IO/Geometry/vtkGLTFWriter.cxx",
"IO/Geometry/vtkGLTFWriterUtils.cxx",
"IO/Geometry/vtkOBJWriter.cxx",
"IO/Geometry/vtkSTLReader.cxx",
],
},
"VTK::IOImage": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"IO/Image/vtkImageExport.cxx",
"IO/Image/vtkImageReader2.cxx",
"IO/Image/vtkImageReader2Collection.cxx",
"IO/Image/vtkImageReader2Factory.cxx",
"IO/Image/vtkImageWriter.cxx",
"IO/Image/vtkJPEGReader.cxx",
"IO/Image/vtkJPEGWriter.cxx",
"IO/Image/vtkPNGReader.cxx",
"IO/Image/vtkPNGWriter.cxx",
"IO/Image/vtkTIFFReader.cxx",
"IO/Image/vtkTIFFWriter.cxx",
],
"module_deps_ignore": [
"VTK::DICOMParser",
"VTK::metaio",
],
},
"VTK::IOImport": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"IO/Import/vtkImporter.cxx",
"IO/Import/vtkGLTFImporter.cxx",
],
},
"VTK::IOLegacy": {
"visibility": ["//visibility:public"],
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"IO/Legacy/vtkDataReader.cxx",
"IO/Legacy/vtkUnstructuredGridReader.cxx",
],
},
"VTK::ImagingCore": {
"visibility": ["//visibility:public"],
},
"VTK::RenderingCore": {
"visibility": ["//visibility:public"],
"copts_extra": [
# Match the VTK defaults.
"-DVTK_OPENGL2",
],
},
"VTK::RenderingOpenGL2": {
"visibility": ["//visibility:public"],
"cmake_defines": select({
":osx": [
"VTK_USE_COCOA",
],
"//conditions:default": [
"VTK_USE_X",
],
}),
"cmake_undefines": [
"VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN",
"VTK_OPENGL_ENABLE_STREAM_ANNOTATIONS",
"VTK_OPENGL_HAS_EGL",
"VTK_OPENGL_HAS_OSMESA",
"VTK_REPORT_OPENGL_ERRORS",
"VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS",
"VTK_USE_CORE_GRAPHICS",
"VTK_USE_DIRECTX",
"VTK_USE_NVCONTROL",
] + select({
":osx": [
"VTK_USE_X",
],
"//conditions:default": [
"VTK_USE_COCOA",
],
}),
"hdrs_extra": [
":generated_rendering_opengl2_sources",
],
"srcs_glob_exclude": [
# This is configure-time setup code, not library code.
"**/vtkProbe*",
# Avoid building unnecessary VTK::RenderingHyperTreeGrid.
"**/*HyperTreeGrid*",
# Exclude all renderers by default; we'll incorporate the necessary
# ones using with srcs_extra immediately below.
"**/vtkCocoa*",
"**/vtkEGL*",
"**/vtkOSOpenGL*",
"**/vtkSDL2OpenGL*",
"**/vtkWin32OpenGL*",
"**/vtkXOpenGL*",
],
"srcs_objc_non_arc": select({
":osx": [
"Rendering/OpenGL2/vtkCocoaGLView.mm",
"Rendering/OpenGL2/vtkCocoaRenderWindow.mm",
],
"//conditions:default": [],
}),
"srcs_extra": select({
":osx": [],
"//conditions:default": [
"Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx",
],
}) + [
# The vtkObjectFactory.cmake logic for vtk_object_factory_configure
# is too difficult to implement in Bazel at the moment. Instead,
# we'll commit the two generated files and directly mention them.
"@drake//tools/workspace/vtk_internal:gen/vtkRenderingOpenGL2ObjectFactory.h", # noqa
"@drake//tools/workspace/vtk_internal:gen/vtkRenderingOpenGL2ObjectFactory.cxx", # noqa
],
"linkopts_extra": select({
":osx": [
# Mimic vtk_module_link(... "-framework Cocoa") from upstream.
"-framework Cocoa",
],
"//conditions:default": [],
}),
"deps_extra": select({
":osx": [],
"//conditions:default": [
# Mimic vtk_module_link(... X11::X11) from upstream.
"@x11",
],
}),
"module_deps_ignore": [
"VTK::RenderingHyperTreeGrid",
],
},
"VTK::RenderingUI": {
# This module has a lot of code we don't need. We'll opt-out of the
# default srcs glob, and instead just specify what Drake needs.
"srcs_glob_exclude": ["**"],
"srcs_extra": [
"Rendering/UI/vtkGenericRenderWindowInteractor.cxx",
],
},
# Third, we'll configure dependencies that come from Drake's WORKSPACE.
"VTK::fmt": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_VTK_fmt=1",
],
"deps_extra": [
"@fmt",
],
},
"VTK::jpeg": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_vtkjpeg=1",
],
"hdrs_glob_exclude": [
"ThirdParty/jpeg/vtkjpeg/**",
],
"deps_extra": [
# TODO(jwnimmer-tri) VTK is the only user of this library.
# We should write our own WORKSPACE rule to build it sensibly,
# or switch to VTK's vendored version.
"@libjpeg",
],
},
"VTK::nlohmannjson": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_vtknlohmannjson=1",
],
"deps_extra": [
"@nlohmann_internal//:nlohmann",
],
},
"VTK::opengl": {
"deps_extra": [
"@opengl",
],
},
"VTK::png": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_vtkpng=1",
],
"deps_extra": [
# TODO(jwnimmer-tri) VTK is the only user of this library.
# We should write our own WORKSPACE rule to build it sensibly,
# or switch to VTK's vendored version.
"@libpng",
],
},
"VTK::tiff": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_vtktiff=1",
],
"deps_extra": [
# TODO(jwnimmer-tri) VTK is the only user of this library.
# We should write our own WORKSPACE rule to build it sensibly,
# or switch to VTK's vendored version.
"@libtiff",
],
},
"VTK::zlib": {
"cmake_defines": [
"VTK_MODULE_USE_EXTERNAL_vtkzlib=1",
],
"deps_extra": [
"@zlib",
],
},
# Fourth, we'll configure dependencies that we let VTK build and vendor on
# its own, because nothing else in Drake needs these. Anything added here
# must have its license file added to the install in `package.BUILD.bazel`.
# VTK's name mangling of these is a little bit weak (it just adds "vtk" to
# the front, leaving them as public symbols); we might want to improve upon
# that later on.
"VTK::doubleconversion": {
"cmake_undefines": [
"VTK_MODULE_USE_EXTERNAL_vtkdoubleconversion",
],
"hdrs_content": {
"ThirdParty/doubleconversion/vtkdoubleconversion_export.h": """
#pragma once
#define VTKDOUBLECONVERSION_EXPORT
""",
},
"srcs_glob_extra": [
"ThirdParty/doubleconversion/**/*.cc",
],
},
"VTK::glew": {
"cmake_undefines": [
"VTK_GLEW_SHARED",
"VTK_MODULE_USE_EXTERNAL_vtkglew",
"VTK_MODULE_vtkglew_GLES3",
],
"srcs_extra": [
"ThirdParty/glew/vtkglew/src/glew.c",
],
"copts_extra": [
"-Iexternal/vtk_internal/ThirdParty/glew/vtkglew/include",
# Match the target_compile_definitions() from CMakeLists.txt.
"-DGLEW_NO_GLU",
],
"linkopts_extra": select({
":osx": [],
"//conditions:default": [
"-lX11",
"-lGLX",
],
}),
},
"VTK::pugixml": {
# TODO(jwnimmer-tri) The only user of pugixml is vtkDataAssembly.
# Possibly there is some way to disable XML I/O support on that
# class, so that we can drop this dependency.
"cmake_undefines": [
"VTK_MODULE_USE_EXTERNAL_vtkpugixml",
],
"hdrs_glob_exclude": [
# We use `hdrs_content` instead of a full-blown configure file.
"**/pugiconfig.hpp.in",
],
"hdrs_content": {
"ThirdParty/pugixml/pugiconfig.hpp": """
#pragma once
#define PUGIXML_API
""",
},
"srcs_glob_extra": [
"ThirdParty/pugixml/**/*.cpp",
],
},
"VTK::utf8": {
"cmake_undefines": [
"VTK_MODULE_USE_EXTERNAL_vtkutf8",
],
},
}