diff --git a/tools/bazel.rc b/tools/bazel.rc index 433c21a4e329..e5ba5626692b 100644 --- a/tools/bazel.rc +++ b/tools/bazel.rc @@ -5,7 +5,7 @@ build --incompatible_load_python_rules_from_bzl=yes build -c opt # Default build options. -build --force_pic +# build --force_pic build --strip=never build --strict_system_includes diff --git a/tools/workspace/vtk_internal/package.BUILD.bazel b/tools/workspace/vtk_internal/package.BUILD.bazel index bb11b64eaaad..9a9406ff32af 100644 --- a/tools/workspace/vtk_internal/package.BUILD.bazel +++ b/tools/workspace/vtk_internal/package.BUILD.bazel @@ -18,6 +18,29 @@ config_setting( constraint_values = ["@platforms//os:osx"], ) +objc_library( + name = "rendering_opengl2_vtkCocoaRenderWindow", + non_arc_srcs = [ + "Rendering/OpenGL2/vtkCocoaGLView.mm", + "Rendering/OpenGL2/vtkCocoaRenderWindow.mm", + ], + hdrs = [ + "Rendering/OpenGL2/vtkCocoaGLView.h", + "Rendering/OpenGL2/vtkCocoaRenderWindow.h", + "Rendering/OpenGL2/vtkOpenGLRenderWindow.h", + "Rendering/OpenGL2/vtkOpenGLState.h", + "Rendering/OpenGL2/vtkOpenGLVertexBufferObjectCache.h", + "Rendering/OpenGL2/vtkRenderingOpenGL2Module.h", + ], + includes = ["Rendering/OpenGL2"], + sdk_frameworks = ["Cocoa"], + copts = ["-w"], + deps = [ + ":VTK__RenderingUI", + ":VTK__glew", + ], +) + # Generate some source files on the fly, using Bazel re-implementations of # various CMake scripts. diff --git a/tools/workspace/vtk_internal/settings.bzl b/tools/workspace/vtk_internal/settings.bzl index 1ae9700d5bcd..1859a1abbd3a 100644 --- a/tools/workspace/vtk_internal/settings.bzl +++ b/tools/workspace/vtk_internal/settings.bzl @@ -341,8 +341,8 @@ MODULE_SETTINGS = { ], "srcs_extra": select({ ":osx": [ - "Rendering/OpenGL2/vtkCocoaGLView.mm", - "Rendering/OpenGL2/vtkCocoaRenderWindow.mm", + # "Rendering/OpenGL2/vtkCocoaGLView.mm", + # "Rendering/OpenGL2/vtkCocoaRenderWindow.mm", ], "//conditions:default": [ "Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx", @@ -355,7 +355,9 @@ MODULE_SETTINGS = { "@drake//tools/workspace/vtk_internal:gen/vtkRenderingOpenGL2ObjectFactory.cxx", # noqa ], "deps_extra": select({ - ":osx": [], + ":osx": [ + ":rendering_opengl2_vtkCocoaRenderWindow", + ], "//conditions:default": [ # Mimic vtk_module_link(VTK::RenderingOpenGL2 PUBLIC X11::X11). "@x11",