]> granicus.if.org Git - clang/commitdiff
Moved here from LLVM Clang's configuration options and related macros.
authorOscar Fuentes <ofv@wanadoo.es>
Thu, 3 Feb 2011 22:48:20 +0000 (22:48 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Thu, 3 Feb 2011 22:48:20 +0000 (22:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124825 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt
include/clang/Config/config.h.cmake [new file with mode: 0644]
lib/Driver/Driver.cpp
lib/Frontend/InitHeaderSearch.cpp

index 8722882eaf6722a5bf3e716b747aa2fc6c74477d..f7989bc1feb6365403a7535f9f371838c620bdd0 100644 (file)
@@ -54,6 +54,12 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
   add_definitions( -D__STDC_CONSTANT_MACROS )
 endif()
 
+set(CLANG_RESOURCE_DIR "" CACHE STRING
+  "Relative directory from the Clang binary to its resource files.")
+
+set(C_INCLUDE_DIRS "" CACHE STRING
+  "Colon separated list of directories clang will search for headers.")
+
 set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -108,6 +114,10 @@ if (APPLE)
   set(CMAKE_MODULE_LINKER_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
 endif ()
 
+configure_file(
+  ${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake
+  ${CLANG_BINARY_DIR}/include/clang/Config/config.h)
+
 macro(add_clang_library name)
   llvm_process_sources(srcs ${ARGN})
   if(MSVC_IDE OR XCODE)
@@ -186,7 +196,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
   PATTERN "*.inc"
   )
 
-add_definitions( -D_GNU_SOURCE )
+add_definitions( -D_GNU_SOURCE -DHAVE_CLANG_CONFIG_H )
 
 option(CLANG_BUILD_EXAMPLES "Build CLANG example programs." OFF)
 if(CLANG_BUILD_EXAMPLES)
diff --git a/include/clang/Config/config.h.cmake b/include/clang/Config/config.h.cmake
new file mode 100644 (file)
index 0000000..5f13d2f
--- /dev/null
@@ -0,0 +1,17 @@
+/* Relative directory for resource files */
+#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
+
+/* 32 bit multilib directory. */
+#define CXX_INCLUDE_32BIT_DIR "${CXX_INCLUDE_32BIT_DIR}"
+
+/* 64 bit multilib directory. */
+#define CXX_INCLUDE_64BIT_DIR "${CXX_INCLUDE_64BIT_DIR}"
+
+/* Arch the libstdc++ headers. */
+#define CXX_INCLUDE_ARCH "${CXX_INCLUDE_ARCH}"
+
+/* Directory with the libstdc++ headers. */
+#define CXX_INCLUDE_ROOT "${CXX_INCLUDE_ROOT}"
+
+/* Directories clang will search for headers */
+#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}"
index d56b1d29740cb83476f1efd1c466b91b1c946e85..6edc46cdc18a47a910d2a85876f918d2b4ab57de 100644 (file)
@@ -7,6 +7,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifdef HAVE_CLANG_CONFIG_H
+# include "clang/Config/config.h"
+#endif
+
 #include "clang/Driver/Driver.h"
 
 #include "clang/Driver/Action.h"
index 7fa7d0162fc92bd77f90274736709ca35ec50170..d68103381536b0973d3e2087fa1465e2a7e374e6 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
+#ifdef HAVE_CLANG_CONFIG_H
+# include "clang/Config/config.h"
+#endif
+
 #include "clang/Frontend/Utils.h"
 #include "clang/Basic/FileManager.h"
 #include "clang/Basic/LangOptions.h"