set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
endif ()
-# libxml2 is an optional dependency, required only to run validation
-# tests on XML output.
-find_package(LibXml2)
-
configure_file(
${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake
${CLANG_BINARY_DIR}/include/clang/Config/config.h)
LINKER_LANGUAGE CXX)
# If libxml2 is available, make it available for c-index-test.
-if (LIBXML2_FOUND)
- add_definitions(${LIBXML2_DEFINITIONS} "-DCLANG_HAVE_LIBXML")
+if (CLANG_HAVE_LIBXML)
include_directories(${LIBXML2_INCLUDE_DIR})
target_link_libraries(c-index-test ${LIBXML2_LIBRARIES})
endif()
set(ENABLE_PIC 0)
endif()
+find_package(LibXml2)
+if (LIBXML2_FOUND)
+ set(CLANG_HAVE_LIBXML 1)
+endif ()
+
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
/* Bug report URL. */
#define BUG_REPORT_URL "${BUG_REPORT_URL}"
+/* Define if we have libxml2 */
+#cmakedefine CLANG_HAVE_LIBXML ${CLANG_HAVE_LIBXML}
+
/* Relative directory for resource files */
#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"