Skip to content

Commit 5c90082

Browse files
committed
Exclude experimental Trilinos files from unity build to avoid name conflicts and ensure correct include order
1 parent b0a8468 commit 5c90082

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

applications/TrilinosApplication/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ ENDIF(CMAKE_UNITY_BUILD MATCHES ON)
116116

117117
# Exclude from unity build
118118
set_source_files_properties (${CMAKE_CURRENT_SOURCE_DIR}/custom_utilities/linear_solver_trilinos.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
119+
# The experimental (Tpetra) files include MatrixMarket_Tpetra.hpp → mmio_Tpetra.h, which shares the
120+
# same MM_IO_H include guard as Kratos' mmio.h but declares mm_read_mtx_crd_size with size_t*
121+
# instead of int*. When merged into a unity unit with Epetra-based files that have already pulled
122+
# in Kratos' mmio.h, the guard prevents mmio_Tpetra.h from being re-included, leaving the wrong
123+
# signature in scope. Compiling the experimental files as separate translation units ensures the
124+
# correct include order and avoids free-function name conflicts with the Epetra equivalents.
125+
set_source_files_properties (${CMAKE_CURRENT_SOURCE_DIR}/custom_python/add_trilinos_space_experimental_to_python.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
126+
if(${KRATOS_BUILD_TESTING} MATCHES ON)
127+
set_source_files_properties (${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/test_trilinos_space_experimental.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
128+
set_source_files_properties (${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/trilinos_cpp_test_experimental_utilities.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
129+
set_source_files_properties (${CMAKE_CURRENT_SOURCE_DIR}/tests/cpp_tests/utilities/test_cpp_test_utilities_experimental.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
130+
endif()
119131

120132
# Changing the .dll suffix to .pyd
121133
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

0 commit comments

Comments
 (0)