Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 253 forks source link

precompiled headers again? #1048

Open Dushistov opened 7 years ago

Dushistov commented 7 years ago

Please mark appropriate

Problem description

Describe briefly the problem.

Looks like problem that was solved in 47cd87a11fdbfd0b2c25fd630154d5d3a20d8c30 And appears again.

I run rdm in such way:

nice ./bin/rdm -v -v -j4 --isystem /usr/include/c++/7.1.1 --isystem /usr/bin/../lib/clang/4.0.1/include --isystem /usr/include

In rdm outputs I constantly (for each file):

fatal error: file '/tmp/build_pl_trunk_amd64/pl_precompiled_headers.h.gch' is not a valid precompiled PCH file

I use precompiled headers by adding -include, /tmp/build_pl_trunk_amd64/pl_precompiled_headers.h to each invocation of compiler. Actually cmake do it for me.

Expected behavior

Describe what you expected to happen. Parsing of my projects without problems.

Actual behavior

Describe what actually happened.

Can not jump to definitions, looks like because of rdm failed to parse every c++ file.

Environment

Dushistov commented 7 years ago

I checkout b4db16f5c1a813fba16f28e32d40853ae6ea8d7b and works fine, so bug was introduced after b4db16f5c1a813fba16f28e32d40853ae6ea8d7b

Andersbakken commented 7 years ago

Any chance you can send a tiny cmake-based example showing how you do the pch stuff? I've been meaning to try to make pch work better and a functional real-world (even if it is just one file) example would be a nice starting point.

Anders

On Mon, Sep 4, 2017 at 12:54 PM, Evgeniy Dushistov <notifications@github.com

wrote:

I checkout b4db16f https://github.com/Andersbakken/rtags/commit/b4db16f5c1a813fba16f28e32d40853ae6ea8d7b and works fine, so bug was introduced after b4db16f https://github.com/Andersbakken/rtags/commit/b4db16f5c1a813fba16f28e32d40853ae6ea8d7b

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/1048#issuecomment-327021093, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEdSlsAu5ttIVZ9qig4Wc-TVpHg4Rueks5sfFVvgaJpZM4PMNGM .

Dushistov commented 7 years ago

@Andersbakken

Any chance you can send a tiny cmake-based example showing how you do the pch stuff?

In attachment, I work with this code only on Linux/gcc, may be with modern cmake possible to write more clean code, but it still works since many years it was written.

cmake_pch.zip