From ce02361a6491127f4b279ac6ef022f7036c25d07 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Fri, 27 Aug 2021 16:38:04 +0100 Subject: [PATCH] Only build XMLValidator when XMP is enabled. --- src/CMakeLists.txt | 6 ++++-- src/xmp.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c0f0a2d8..ea5ea353 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -173,8 +173,10 @@ target_include_directories(exiv2lib SYSTEM PRIVATE $ ) -target_include_directories(exiv2lib PRIVATE ${EXPAT_INCLUDE_DIR}) -target_link_libraries(exiv2lib PRIVATE EXPAT::EXPAT) +if (EXIV2_ENABLE_XMP OR EXIV2_ENABLE_EXTERNAL_XMP) + target_include_directories(exiv2lib PRIVATE ${EXPAT_INCLUDE_DIR}) + target_link_libraries(exiv2lib PRIVATE EXPAT::EXPAT) +endif() if (EXIV2_ENABLE_XMP) target_link_libraries(exiv2lib PRIVATE exiv2-xmp) diff --git a/src/xmp.cpp b/src/xmp.cpp index 7146105c..dc0dfff2 100644 --- a/src/xmp.cpp +++ b/src/xmp.cpp @@ -43,6 +43,7 @@ # include #endif // EXV_HAVE_XMP_TOOLKIT +#ifdef EXV_HAVE_XMP_TOOLKIT // This anonymous namespace contains a class named XMLValidator, which uses // libexpat to do a basic validation check on an XML document. This is to // reduce the chance of hitting a bug in the (third-party) xmpsdk @@ -203,7 +204,7 @@ namespace { } }; } // namespace - +#endif // EXV_HAVE_XMP_TOOLKIT // ***************************************************************************** // local declarations