From daf5881128144b36a01ce501d7aef3de688e343f Mon Sep 17 00:00:00 2001 From: Oscar Fuentes Date: Tue, 10 Aug 2010 23:48:22 +0000 Subject: [PATCH] Avoid multiple definition warnings when both config.h and llvm-config.h are included. This is the cmake counterpart of r110547. See bug #7809. llvm-svn: 110753 --- llvm/include/llvm/Config/config.h.cmake | 5 +++++ llvm/include/llvm/Config/llvm-config.h.cmake | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake index d9f95a6bfaa7..81e6ab574863 100644 --- a/llvm/include/llvm/Config/config.h.cmake +++ b/llvm/include/llvm/Config/config.h.cmake @@ -3,6 +3,9 @@ ** Created by Kevin from config.h.in ** ***************************************/ +#ifndef CONFIG_H +#define CONFIG_H + /* Define if dlopen(0) will open the symbols of the program */ #undef CAN_DLOPEN_SELF @@ -628,3 +631,5 @@ /* Native LLVM architecture, short name */ #cmakedefine LLVM_NATIVE_ARCHNAME ${LLVM_NATIVE_ARCH} + +#endif diff --git a/llvm/include/llvm/Config/llvm-config.h.cmake b/llvm/include/llvm/Config/llvm-config.h.cmake index c277ef2b2077..b68592a64a0a 100644 --- a/llvm/include/llvm/Config/llvm-config.h.cmake +++ b/llvm/include/llvm/Config/llvm-config.h.cmake @@ -11,6 +11,11 @@ they can be in exported headers and won't override package specific directives. This is a C file so we can include it in the llvm-c headers. */ +/* To avoid multiple inclusions of these variables when we include the exported + headers and config.h, conditionally include these. */ +/* TODO: This is a bit of a hack. */ +#ifndef CONFIG_H + /* Installation directory for binary executables */ #cmakedefine LLVM_BINDIR "${LLVM_BINDIR}" @@ -82,3 +87,5 @@ /* Installation prefix directory */ #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}" + +#endif