[clang-tools-extra] r291892 - Fix the build of the include-fixer plugin for some shared cmake builds and MSVC.

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 4 18:32:21 PST 2017


Hi Ben,

This change doesn't work when doing out-of-tree builds since `PTHREAD_LIB`
is defined by LLVM's `config-ix.cmake` and
therefore isn't defined during out-of-tree builds. It looks like the
pthread configuration needs to be lifted out of LLVM's
`config-ix.cmake` and placed somewhere the installed `AddLLVM.cmake` can
see it.

I don't think it's critical to fix this for the 4.0 release, but it should
get fixed.

@Ben do you see a better way to fix this?

On Mon, Jan 23, 2017 at 3:17 PM, Hans Wennborg via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> I've merged this to the release branch in r292834.
>
> Thanks,
> Hans
>
> On Fri, Jan 13, 2017 at 2:14 AM, Benjamin Kramer via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
> > Author: d0k
> > Date: Fri Jan 13 04:14:07 2017
> > New Revision: 291892
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=291892&view=rev
> > Log:
> > Fix the build of the include-fixer plugin for some shared cmake builds
> and MSVC.
> >
> > - The include fixer plugin does not directly depend on pthread, but can
> > pick up pthread references transitively through inlining. Just add
> > pthreads to the linked libs unconditionally.
> > - MSVC emits bogus warnings when including <future> and building without
> > exceptions. Blacklist the warnings explicitly.
> >
> > Modified:
> >     clang-tools-extra/trunk/include-fixer/SymbolIndexManager.h
> >     clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt
> >
> > Modified: clang-tools-extra/trunk/include-fixer/SymbolIndexManager.h
> > URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/include-fixer/SymbolIndexManager.h?rev=291892&r1=291891&r2=291892&
> view=diff
> > ============================================================
> ==================
> > --- clang-tools-extra/trunk/include-fixer/SymbolIndexManager.h
> (original)
> > +++ clang-tools-extra/trunk/include-fixer/SymbolIndexManager.h Fri Jan
> 13 04:14:07 2017
> > @@ -13,8 +13,19 @@
> >  #include "SymbolIndex.h"
> >  #include "find-all-symbols/SymbolInfo.h"
> >  #include "llvm/ADT/StringRef.h"
> > +
> > +#ifdef _MSC_VER
> > +// Disable warnings from ppltasks.h transitively included by <future>.
> > +#pragma warning(push)
> > +#pragma warning(disable:4530)
> > +#endif
> > +
> >  #include <future>
> >
> > +#ifdef _MSC_VER
> > +#pragma warning(pop)
> > +#endif
> > +
> >  namespace clang {
> >  namespace include_fixer {
> >
> >
> > Modified: clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt
> > URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/
> trunk/include-fixer/plugin/CMakeLists.txt?rev=291892&r1=
> 291891&r2=291892&view=diff
> > ============================================================
> ==================
> > --- clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt
> (original)
> > +++ clang-tools-extra/trunk/include-fixer/plugin/CMakeLists.txt Fri Jan
> 13 04:14:07 2017
> > @@ -9,4 +9,5 @@ add_clang_library(clangIncludeFixerPlugi
> >    clangParse
> >    clangSema
> >    clangTooling
> > +  ${PTHREAD_LIB}
> >    )
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170204/99496aa7/attachment.html>


More information about the cfe-commits mailing list