User forums > General (but related to Code::Blocks)
Build force to compile all cpp's
Sagaceil:
Hi !
I'm dealing with some anoying issue. When I do some minor change in one cpp file, and try to build project it recompiles all cpp units. I have proper PCH file (as said here http://wiki.codeblocks.org/index.php?title=Precompiled_headers , with generated gch file ).
Does something need to be set in C::B or in build setting ? Its really paint in the ass to wait several minutes and see how ~800 cpp's are compiling just to check little change :p
Thanks for any help !
stahta01:
If you change only what is in a cpp file then you should NOT have to build all the cpp files.
NOTE: If you change what is included inside a header than every file that includes that header needs to be recompiled.
Did not read the PCH info on link; but, you should know that much of the info on the web is incomplete.
MinGW GCC only uses a PCH file with included first thing in a compilation unit!
This means including a PCH file from inside a header is a waste of time!.
Edit: It also means you can NOT include another file before the PCH file.
Some #pragmas can NOT be before the including of a PCH file.
NOTE: Some headers can NOT be included inside a PCH file because the header does some operations not supported by MinGW GCC.
Tim S.
Sagaceil:
Yup, I have arleady setup all the things you mentioned : the very first include in every cpp, classic #ifndef/endif guards, no PCH includes in any headers (only cpp's). Choosing proper PCH location in Build Options makes different (using 'Generate PCH in a directory alongside the original file' speeds up like 2x, so somehow PCH works).
--- Code: ----------------- Buduj: EditorFull in BarokEngine (compiler: GNU GCC Compiler)---------------
[ 0.0%] Pre-compiling header: build.h
.... another gazilion cpp units ;P
[100.0%] Konsolidacja plik wykonywalny: HostApp.exe
--- End code ---
As I imagine, there should be only that cpp files in the log that were actually changed ? I'm aware of changing header file forces the recompile all dependcies.
stahta01:
Are you positive you are doing build instead of rebuild?
If you do a second build right after the first, does it say nothing to be done or what?
Tim S.
oBFusCATed:
Just a note: When asking for help it is best to post logs and error messages in english and not in your native language... The chance for someone to help you is quite a lot higher.
Navigation
[0] Message Index
[#] Next page
Go to full version