r212995 - Fix the !CLANG_ENABLE_ARCMT build

Alp Toker alp at nuanti.com
Mon Jul 14 15:17:16 PDT 2014


Author: alp
Date: Mon Jul 14 17:17:16 2014
New Revision: 212995

URL: http://llvm.org/viewvc/llvm-project?rev=212995&view=rev
Log:
Fix the !CLANG_ENABLE_ARCMT build

Modified:
    cfe/trunk/test/CMakeLists.txt
    cfe/trunk/tools/CMakeLists.txt
    cfe/trunk/tools/libclang/ARCMigrate.cpp
    cfe/trunk/tools/libclang/CMakeLists.txt

Modified: cfe/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=212995&r1=212994&r2=212995&view=diff
==============================================================================
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Mon Jul 14 17:17:16 2014
@@ -26,11 +26,18 @@ endif ()
 
 list(APPEND CLANG_TEST_DEPS
   clang clang-headers
-  c-index-test diagtool arcmt-test c-arcmt-test
+  c-index-test diagtool
   clang-check clang-format
   clang-tblgen
   )
 
+if (CLANG_ENABLE_ARCMT)
+  list(APPEND CLANG_TEST_DEPS
+    arcmt-test
+    c-arcmt-test
+  )
+endif ()
+
 if (ENABLE_CLANG_EXAMPLES)
   list(APPEND CLANG_TEST_DEPS
     clang-interpreter

Modified: cfe/trunk/tools/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CMakeLists.txt?rev=212995&r1=212994&r2=212995&view=diff
==============================================================================
--- cfe/trunk/tools/CMakeLists.txt (original)
+++ cfe/trunk/tools/CMakeLists.txt Mon Jul 14 17:17:16 2014
@@ -5,9 +5,10 @@ if(CLANG_ENABLE_REWRITER)
   add_subdirectory(clang-format-vs)
 endif()
 
+add_subdirectory(c-index-test)
+add_subdirectory(libclang)
+
 if(CLANG_ENABLE_ARCMT)
-  add_subdirectory(libclang)
-  add_subdirectory(c-index-test)
   add_subdirectory(arcmt-test)
   add_subdirectory(c-arcmt-test)
 endif()

Modified: cfe/trunk/tools/libclang/ARCMigrate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/ARCMigrate.cpp?rev=212995&r1=212994&r2=212995&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/ARCMigrate.cpp (original)
+++ cfe/trunk/tools/libclang/ARCMigrate.cpp Mon Jul 14 17:17:16 2014
@@ -35,6 +35,10 @@ struct Remap {
 extern "C" {
 
 CXRemapping clang_getRemappings(const char *migrate_dir_path) {
+#ifndef CLANG_ENABLE_ARCMT
+  llvm::errs() << "error: feature not enabled in this build\n";
+  return nullptr;
+#else
   bool Logging = ::getenv("LIBCLANG_LOGGING");
 
   if (!migrate_dir_path) {
@@ -71,10 +75,15 @@ CXRemapping clang_getRemappings(const ch
   }
 
   return remap.release();
+#endif
 }
 
 CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
                                             unsigned numFiles) {
+#ifndef CLANG_ENABLE_ARCMT
+  llvm::errs() << "error: feature not enabled in this build\n";
+  return nullptr;
+#else
   bool Logging = ::getenv("LIBCLANG_LOGGING");
 
   std::unique_ptr<Remap> remap(new Remap());
@@ -112,6 +121,7 @@ CXRemapping clang_getRemappingsFromFileL
   }
 
   return remap.release();
+#endif
 }
 
 unsigned clang_remap_getNumFiles(CXRemapping map) {

Modified: cfe/trunk/tools/libclang/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CMakeLists.txt?rev=212995&r1=212994&r2=212995&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CMakeLists.txt (original)
+++ cfe/trunk/tools/libclang/CMakeLists.txt Mon Jul 14 17:17:16 2014
@@ -37,6 +37,20 @@ set(SOURCES
   ../../include/clang-c/Index.h
   )
 
+set(LIBS
+  clangAST
+  clangBasic
+  clangFrontend
+  clangIndex
+  clangLex
+  clangSema
+  clangTooling
+)
+
+if (CLANG_ENABLE_ARCMT)
+  list(APPEND LIBS clangARCMigrate)
+endif ()
+
 option(LIBCLANG_BUILD_STATIC
   "Build libclang as a static library (in addition to a shared one)" OFF)
 
@@ -69,14 +83,7 @@ add_clang_library(libclang ${ENABLE_SHAR
   DEPENDS clang-headers
 
   LINK_LIBS
-  clangARCMigrate
-  clangAST
-  clangBasic
-  clangFrontend
-  clangIndex
-  clangLex
-  clangSema
-  clangTooling
+  ${LIBS}
 
   LINK_COMPONENTS
   BitReader





More information about the cfe-commits mailing list