From c47ffa1e1b2e9e74c81e04ecb51bc71db028ff53 Mon Sep 17 00:00:00 2001
From: David Gobbi <david.gobbi@gmail.com>
Date: Thu, 28 Nov 2024 21:14:58 -0700
Subject: [PATCH] Skip vtkDataObjectImplicitBackendInstantiateIdType

Since vtkIdType is just a typedef for one of the fundamental
types for which the template is already instantiated, we must
avoid instantiating for vtkIdType since the instantiation will
result in duplicate template symbols.  Most linkers will handle
the duplicated template symbols, but some linkers will generate
an error.
---
 Common/DataModel/CMakeLists.txt | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Common/DataModel/CMakeLists.txt b/Common/DataModel/CMakeLists.txt
index 98631ffbe1e..959b489c0c4 100644
--- a/Common/DataModel/CMakeLists.txt
+++ b/Common/DataModel/CMakeLists.txt
@@ -315,9 +315,12 @@ set(private_templates
 include(vtkTypeLists)
 
 set(instantiation_sources)
-foreach (_type IN LISTS vtk_numeric_types)
-  set(INSTANTIATION_VALUE_TYPE "${_type}")
-  vtk_type_to_camel_case("${_type}" _cased_type)
+foreach (INSTANTIATION_VALUE_TYPE IN LISTS vtk_numeric_types)
+  # only instantiate fundamental types, not typedefs
+  if (INSTANTIATION_VALUE_TYPE STREQUAL "vtkIdType")
+    continue()
+  endif ()
+  vtk_type_to_camel_case("${INSTANTIATION_VALUE_TYPE}" _cased_type)
   configure_file(
     "${CMAKE_CURRENT_SOURCE_DIR}/vtkDataObjectImplicitBackendInstantiate.cxx.in"
     "${CMAKE_CURRENT_BINARY_DIR}/vtkDataObjectImplicitBackendInstantiate${_cased_type}.cxx")
-- 
GitLab