diff --git a/gui/test/benchmark/simple/CMakeLists.txt b/gui/test/benchmark/simple/CMakeLists.txt index 78cf81270..25e787819 100644 --- a/gui/test/benchmark/simple/CMakeLists.txt +++ b/gui/test/benchmark/simple/CMakeLists.txt @@ -1,11 +1,13 @@ qt5_wrap_cpp(test-benchmark-simple_SRC benchmarksimple.h) add_custom_target(build-testbenchmark-simple-deps SOURCES ${test-benchmark-simple_SRC}) add_dependencies(gui-build-deps build-testbenchmark-simple-deps) +if(USE_BUNDLED_TINYXML2) + list(APPEND test-benchmark-simple_SRC $) +endif() add_executable(benchmark-simple ${test-benchmark-simple_SRC} benchmarksimple.cpp $ - $ $ ) target_include_directories(benchmark-simple PRIVATE ${CMAKE_SOURCE_DIR}/lib) @@ -16,4 +18,7 @@ if (HAVE_RULES) endif() if (USE_Z3) target_link_libraries(benchmark-simple ${Z3_LIBRARIES}) -endif() \ No newline at end of file +endif() +if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2) + target_link_libraries(benchmark-simple tinyxml2) +endif() diff --git a/gui/test/xmlreportv2/CMakeLists.txt b/gui/test/xmlreportv2/CMakeLists.txt index a244ea722..5dd39465c 100644 --- a/gui/test/xmlreportv2/CMakeLists.txt +++ b/gui/test/xmlreportv2/CMakeLists.txt @@ -22,4 +22,7 @@ if (HAVE_RULES) endif() if (USE_Z3) target_link_libraries(test-xmlreportv2 ${Z3_LIBRARIES}) -endif() \ No newline at end of file +endif() +if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2) + target_link_libraries(test-xmlreportv2 tinyxml2) +endif() diff --git a/oss-fuzz/CMakeLists.txt b/oss-fuzz/CMakeLists.txt index c0fbd4d1c..5b2c5e059 100644 --- a/oss-fuzz/CMakeLists.txt +++ b/oss-fuzz/CMakeLists.txt @@ -1,11 +1,19 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_executable(fuzz-client EXCLUDE_FROM_ALL + set(fuzz-client_SRC main.cpp type2.cpp + ) + if(USE_BUNDLED_TINYXML2) + list(APPEND fuzz-client_SRC $) + endif() + add_executable(fuzz-client EXCLUDE_FROM_ALL + ${fuzz-client_SRC} $ - $ $) - target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals/tinyxml2 ${CMAKE_SOURCE_DIR}/externals) + target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/lib ${CMAKE_SOURCE_DIR}/externals/simplecpp ${CMAKE_SOURCE_DIR}/externals) + if(USE_BUNDLED_TINYXML2) + target_include_directories(fuzz-client PRIVATE ${CMAKE_SOURCE_DIR}/externals/tinyxml2/) + endif() target_compile_options(fuzz-client PRIVATE -fsanitize=fuzzer) # TODO: target_link_options() requires CMake >= 3.13 #target_link_options(fuzz-client PRIVATE -fsanitize=fuzzer) @@ -16,6 +24,9 @@ if (ENABLE_OSS_FUZZ AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (USE_Z3) target_link_libraries(fuzz-client PRIVATE ${Z3_LIBRARIES}) endif() + if(tinyxml2_FOUND AND NOT USE_BUNDLED_TINYXML2) + target_link_libraries(fuzz-client PRIVATE tinyxml2) + endif() add_executable(translate EXCLUDE_FROM_ALL translate.cpp