Fix the !CLANG_ENABLE_ARCMT build

llvm-svn: 212995
This commit is contained in:
Alp Toker 2014-07-14 22:17:16 +00:00
parent 6462e9e695
commit f55a306996
4 changed files with 36 additions and 11 deletions

View File

@ -26,11 +26,18 @@ endif ()
list(APPEND CLANG_TEST_DEPS list(APPEND CLANG_TEST_DEPS
clang clang-headers clang clang-headers
c-index-test diagtool arcmt-test c-arcmt-test c-index-test diagtool
clang-check clang-format clang-check clang-format
clang-tblgen clang-tblgen
) )
if (CLANG_ENABLE_ARCMT)
list(APPEND CLANG_TEST_DEPS
arcmt-test
c-arcmt-test
)
endif ()
if (ENABLE_CLANG_EXAMPLES) if (ENABLE_CLANG_EXAMPLES)
list(APPEND CLANG_TEST_DEPS list(APPEND CLANG_TEST_DEPS
clang-interpreter clang-interpreter

View File

@ -5,9 +5,10 @@ if(CLANG_ENABLE_REWRITER)
add_subdirectory(clang-format-vs) add_subdirectory(clang-format-vs)
endif() endif()
add_subdirectory(c-index-test)
add_subdirectory(libclang)
if(CLANG_ENABLE_ARCMT) if(CLANG_ENABLE_ARCMT)
add_subdirectory(libclang)
add_subdirectory(c-index-test)
add_subdirectory(arcmt-test) add_subdirectory(arcmt-test)
add_subdirectory(c-arcmt-test) add_subdirectory(c-arcmt-test)
endif() endif()

View File

@ -35,6 +35,10 @@ struct Remap {
extern "C" { extern "C" {
CXRemapping clang_getRemappings(const char *migrate_dir_path) { 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"); bool Logging = ::getenv("LIBCLANG_LOGGING");
if (!migrate_dir_path) { if (!migrate_dir_path) {
@ -71,10 +75,15 @@ CXRemapping clang_getRemappings(const char *migrate_dir_path) {
} }
return remap.release(); return remap.release();
#endif
} }
CXRemapping clang_getRemappingsFromFileList(const char **filePaths, CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
unsigned numFiles) { unsigned numFiles) {
#ifndef CLANG_ENABLE_ARCMT
llvm::errs() << "error: feature not enabled in this build\n";
return nullptr;
#else
bool Logging = ::getenv("LIBCLANG_LOGGING"); bool Logging = ::getenv("LIBCLANG_LOGGING");
std::unique_ptr<Remap> remap(new Remap()); std::unique_ptr<Remap> remap(new Remap());
@ -112,6 +121,7 @@ CXRemapping clang_getRemappingsFromFileList(const char **filePaths,
} }
return remap.release(); return remap.release();
#endif
} }
unsigned clang_remap_getNumFiles(CXRemapping map) { unsigned clang_remap_getNumFiles(CXRemapping map) {

View File

@ -37,6 +37,20 @@ set(SOURCES
../../include/clang-c/Index.h ../../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 option(LIBCLANG_BUILD_STATIC
"Build libclang as a static library (in addition to a shared one)" OFF) "Build libclang as a static library (in addition to a shared one)" OFF)
@ -69,14 +83,7 @@ add_clang_library(libclang ${ENABLE_SHARED} ${ENABLE_STATIC}
DEPENDS clang-headers DEPENDS clang-headers
LINK_LIBS LINK_LIBS
clangARCMigrate ${LIBS}
clangAST
clangBasic
clangFrontend
clangIndex
clangLex
clangSema
clangTooling
LINK_COMPONENTS LINK_COMPONENTS
BitReader BitReader