Description: Fix build with unbundled tinyxml.
Author: Joachim Reichel <reichel@debian.org>
Bug: https://trac.cppcheck.net/ticket/10797

Index: cppcheck/gui/test/benchmark/simple/CMakeLists.txt
===================================================================
--- cppcheck.orig/gui/test/benchmark/simple/CMakeLists.txt
+++ cppcheck/gui/test/benchmark/simple/CMakeLists.txt
@@ -5,9 +5,13 @@ add_executable(benchmark-simple
         ${test-benchmark-simple_SRC}
         benchmarksimple.cpp
         $<TARGET_OBJECTS:lib_objs>
-        $<TARGET_OBJECTS:tinyxml2_objs>
         $<TARGET_OBJECTS:simplecpp_objs>
         )
+if(USE_BUNDLED_TINYXML2)
+    add_executable(benchmark-simple $<TARGET_OBJECTS:tinyxml2_objs>)
+else()
+    target_link_libraries(benchmark-simple tinyxml2)
+endif()
 target_include_directories(benchmark-simple PRIVATE ${CMAKE_SOURCE_DIR}/lib)
 target_compile_definitions(benchmark-simple PRIVATE SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
 target_link_libraries(benchmark-simple Qt5::Core Qt5::Test)
Index: cppcheck/gui/test/xmlreportv2/CMakeLists.txt
===================================================================
--- cppcheck.orig/gui/test/xmlreportv2/CMakeLists.txt
+++ cppcheck/gui/test/xmlreportv2/CMakeLists.txt
@@ -14,6 +14,9 @@ add_executable(test-xmlreportv2
         $<TARGET_OBJECTS:lib_objs>
         $<TARGET_OBJECTS:simplecpp_objs>
         )
+if(NOT USE_BUNDLED_TINYXML2)
+    target_link_libraries(test-xmlreportv2 tinyxml2)
+endif()
 target_include_directories(test-xmlreportv2 PRIVATE ${CMAKE_SOURCE_DIR}/gui ${CMAKE_SOURCE_DIR}/lib)
 target_compile_definitions(test-xmlreportv2 PRIVATE SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
 target_link_libraries(test-xmlreportv2 Qt5::Core Qt5::Test)
