"Bo Peng" <[EMAIL PROTECTED]> writes:

| > and how will that change if you include pch.h in all the source files,
| > excepti being overly intrusive? or having some files compiled iwth pch
| > and some not...=?
| 
| I do not think this is a matter of intrusiveness.

 
| By definition, PCH separates commonly used headers from all source
| files, compile them separately to speed up compiling. It is then logic
| to put pch.h into each source file and remove duplicate headers
| accordingly.

No, I do not agree.
 
| Current lyx' approach is peculiar in that pch.h is not included, and
| does not necessarily include commonly used headers.

Our pch files are made from catting the dependency files together
sorting and removing duplicates and singular includes. Unless you want
a pch file for every source file some sourcefiles will get includes
they strictly speaking did not need.

| In pch mode,
| --include=pch.h is passed. This will *not* work with msvc since msvc
| scans source file for a stopping header file like stdafx.h. (Of
| course, bugger off msvc)

What is a 'stopping header file'?

| > | 2. pch.cpp with
| > |    #include <pch.h>
| > why?
| 
| This is a way to make both gcc and msvc happy. I can handle the msvc
| part by generating pch.cpp automatically. http://www.ddj.com/184404800
| is one of the proofs..

I don't quite understand what the pch.cpp file is needed for at all...
 
| > and how will that change if you include pch.h in all the source files,
| > excepti being overly intrusive? or having some files compiled iwth pch
| > and some not...=?
| 
| For msvc. Again, if pch.h is what it is supposed to be, include
| <pch.h> is not intrusive.

Sure it is. The only reason you include it is to accomodate the
compiler.

-- 
        Lgb

Reply via email to