Author Topic: Build force to compile all cpp's  (Read 3829 times)

Offline Sagaceil

  • Single posting newcomer
  • *
  • Posts: 9
Build force to compile all cpp's
« on: September 23, 2014, 11:04:28 pm »
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 !

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
Re: Build force to compile all cpp's
« Reply #1 on: September 23, 2014, 11:16:14 pm »
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.
« Last Edit: September 23, 2014, 11:20:00 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Sagaceil

  • Single posting newcomer
  • *
  • Posts: 9
Re: Build force to compile all cpp's
« Reply #2 on: September 23, 2014, 11:54:26 pm »
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: [Select]
-------------- 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

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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6677
    • My Best Post
Re: Build force to compile all cpp's
« Reply #3 on: September 24, 2014, 12:01:39 am »
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.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12127
    • Travis build status
Re: Build force to compile all cpp's
« Reply #4 on: September 24, 2014, 01:19:58 am »
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Build force to compile all cpp's
« Reply #5 on: September 24, 2014, 05:58:54 am »
You might get such issues, if you have your files on a network server with different time settings.

Offline Sagaceil

  • Single posting newcomer
  • *
  • Posts: 9
Re: Build force to compile all cpp's
« Reply #6 on: September 24, 2014, 09:06:01 am »
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.
Yeah, sorry for that, just quickly copy-pasted it. Didn't noticed that language changed ;) The last log at [100%] is just simply telling that now is linker time ;)

You might get such issues, if you have your files on a network server with different time settings.
Its not the case here. But I've checked timestamps and headers doesn't changed at all. Even turned autosave for sure.

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?
Yes, I'm sure ;) Should there will be promnt to ask to build project when using Run after the code changed ?
« Last Edit: September 24, 2014, 09:19:59 am by Sagaceil »