diff options
author | Marco Bubke <marco.bubke@qt.io> | 2016-11-29 12:53:01 +0100 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2016-12-07 11:38:37 +0000 |
commit | f02dddb6c8f2bf0a59203394bb379d369c9ece11 (patch) | |
tree | 70d478ac1d9bb40c6035266f66a96510132d7dd9 | |
parent | d2f615dca594ec2e152cbfb219c47f45e8741630 (diff) | |
download | qt-creator-f02dddb6c8f2bf0a59203394bb379d369c9ece11.tar.gz |
Clang: Add flag to disable Clang LibTooling
Because of C++ linking problems we introduce QTC_NO_CLANG_LIBTOOLING as a
workaround to disable Clang LibTooling. Use QTC_NO_CLANG_LIBTOOLING=something
to disable it.
Change-Id: I2dc9947d69d94292e08dacb1558bef56f5ebbbe3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r-- | src/plugins/plugins.pro | 8 | ||||
-rw-r--r-- | src/shared/clang/clang_installation.pri | 12 | ||||
-rw-r--r-- | src/tools/tools.pro | 8 | ||||
-rw-r--r-- | tests/unit/unittest/creator_dependency.pri | 4 |
4 files changed, 25 insertions, 7 deletions
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index e4ca70b625..0980a4c49a 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -76,7 +76,13 @@ exists(../shared/qbs/qbs.pro)|!isEmpty(QBS_INSTALL_DIR): \ isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR) exists($$LLVM_INSTALL_DIR) { SUBDIRS += clangcodemodel -# SUBDIRS += clangrefactoring + + QTC_NO_CLANG_LIBTOOLING=$$(QTC_NO_CLANG_LIBTOOLING) + isEmpty($$QTC_NO_CLANG_LIBTOOLING) { + SUBDIRS += clangrefactoring + } else { + warning("Building the Clang refactoring plugin is disabled.") + } } else { warning("Set LLVM_INSTALL_DIR to build the Clang Code Model. " \ "For details, see doc/src/editors/creator-clang-codemodel.qdoc.") diff --git a/src/shared/clang/clang_installation.pri b/src/shared/clang/clang_installation.pri index f3d5194d23..b29f0b56c2 100644 --- a/src/shared/clang/clang_installation.pri +++ b/src/shared/clang/clang_installation.pri @@ -92,9 +92,15 @@ isEmpty(CLANG_LIB): error("Cannot find Clang shared library in $$LLVM_LIBDIR") !contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBCLANG_LIBS = -L$${LLVM_LIBDIR} LIBCLANG_LIBS += $${CLANG_LIB} -!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR} -LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS -contains(QMAKE_DEFAULT_INCDIRS, $$LLVM_INCLUDEPATH): LLVM_INCLUDEPATH = + +QTC_NO_CLANG_LIBTOOLING=$$(QTC_NO_CLANG_LIBTOOLING) +isEmpty(QTC_NO_CLANG_LIBTOOLING) { + !contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR): LIBTOOLING_LIBS = -L$${LLVM_LIBDIR} + LIBTOOLING_LIBS += $$CLANGTOOLING_LIBS $$LLVM_STATIC_LIBS + contains(QMAKE_DEFAULT_INCDIRS, $$LLVM_INCLUDEPATH): LLVM_INCLUDEPATH = +} else { + warning("Clang LibTooling is disabled.") +} isEmpty(LLVM_VERSION): error("Cannot determine clang version at $$LLVM_INSTALL_DIR") !versionIsAtLeast($$LLVM_VERSION, 3, 9, 0): { diff --git a/src/tools/tools.pro b/src/tools/tools.pro index 15849eb63b..35cf3af736 100644 --- a/src/tools/tools.pro +++ b/src/tools/tools.pro @@ -21,7 +21,13 @@ mac { isEmpty(LLVM_INSTALL_DIR):LLVM_INSTALL_DIR=$$(LLVM_INSTALL_DIR) exists($$LLVM_INSTALL_DIR) { SUBDIRS += clangbackend -# SUBDIRS += clangrefactoringbackend + + QTC_NO_CLANG_LIBTOOLING=$$(QTC_NO_CLANG_LIBTOOLING) + isEmpty($$QTC_NO_CLANG_LIBTOOLING) { + SUBDIRS += clangrefactoringbackend + } else { + warning("Building the Clang refactoring back end is disabled.") + } } isEmpty(BUILD_CPLUSPLUS_TOOLS):BUILD_CPLUSPLUS_TOOLS=$$(BUILD_CPLUSPLUS_TOOLS) diff --git a/tests/unit/unittest/creator_dependency.pri b/tests/unit/unittest/creator_dependency.pri index c86b8bc06a..a4a8d31b1e 100644 --- a/tests/unit/unittest/creator_dependency.pri +++ b/tests/unit/unittest/creator_dependency.pri @@ -7,10 +7,10 @@ include($$PWD/../../../src/plugins/coreplugin/corepluginunittestfiles.pri) include($$PWD/../../../src/shared/clang/clang_defines.pri) include($$PWD/../../../src/tools/clangbackend/ipcsource/clangbackendclangipc-source.pri) -include($$PWD/../../../src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri) +!isEmpty(LIBTOOLING_LIBS):include($$PWD/../../../src/tools/clangrefactoringbackend/source/clangrefactoringbackend-source.pri) include($$PWD/../../../src/plugins/clangcodemodel/clangcodemodelunittestfiles.pri) include($$PWD/../../../src/plugins/cpptools/cpptoolsunittestfiles.pri) -include($$PWD/../../../src/plugins/clangrefactoring/clangrefactoring-source.pri) +!isEmpty(LIBTOOLING_LIBS):include($$PWD/../../../src/plugins/clangrefactoring/clangrefactoring-source.pri) include(cplusplus.pri) } |