[Bug pch/36277] Please allow directing pch file localization/usage via direct compiler flag.

bursig at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue May 20 15:42:00 GMT 2008



------- Comment #2 from bursig at gmail dot com  2008-05-20 15:42 -------
(In reply to comment #1)
> I really don't see the issue here really, if you don't setup your include
> pathes correctly to include the object directory first, that seems like your
> issue rather than a limitation of GCC.
> 
Then please create simple pch.h (with stdlib.h included) and main.c (where you
include pch.h) in same dir. Now create obj dir in pwd and build pch.h.gch (gcc
-H -O2 -Iobj pch.h -c -o obj/pch.h.gch) there. Now build main.c as gcc -O2 -H
-Iobj -c -o main.o main.c. As I know gcc search headers in *.c/*.cpp dir before
touch -I search paths.

In my case pch is not used... As I say may before projects already exist and
changing source tree (moving pch headers outoff sources dir) for gcc is not
good news for me because it will automatically disable pch with Sun CC (Sun
require pch.h in source dir).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36277



More information about the Gcc-bugs mailing list