Author Topic: Smarter compiling  (Read 4434 times)

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Smarter compiling
« on: March 28, 2010, 02:57:36 pm »
CB devs, I love your IDE, but there's something that could be improved which would save me a lot of time recompiling:

I'm a library builder, it would be great that when a statically linked library gets updated, any project that links to it would recompile when pressing Ctrl+F9, and possibly only recompile parts that depend on the library.

Second thing, some parts of my library are header files only, it would be great that for any source file, when the header file are updated, the source file is recompiled. Not project bound, just for any source file. I have to recompile everything when I changed a critical header file (smart pointer for example), which takes a lot of unnecessary time.

I am not sure how much this has to do with CodeBlocks itself, or how and whether you create make files. If this can be changed with a plugin or some pre-build option, would be glad to hear.

Thanks!
« Last Edit: March 28, 2010, 03:22:37 pm by Decrius »
Check out my website: http://www.daevius.com

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Smarter compiling
« Reply #1 on: March 28, 2010, 03:28:18 pm »
I'm a library builder, it would be great that when a statically linked library gets updated, any project that links to it would recompile when pressing Ctrl+F9, and possibly only recompile parts that depend on the library.
You can setup external dependencies (to libraries) in the project (target) options. If a library changes the project (target) that depends on the library will be re-build. If an interface to a library has changes this is done automatically as the modules that uses this library should include the header file which was changed and therefore re-compile.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Decrius

  • Multiple posting newcomer
  • *
  • Posts: 81
    • Daevius
Re: Smarter compiling
« Reply #2 on: March 28, 2010, 03:54:46 pm »
I'm a library builder, it would be great that when a statically linked library gets updated, any project that links to it would recompile when pressing Ctrl+F9, and possibly only recompile parts that depend on the library.
You can setup external dependencies (to libraries) in the project (target) options. If a library changes the project (target) that depends on the library will be re-build. If an interface to a library has changes this is done automatically as the modules that uses this library should include the header file which was changed and therefore re-compile.

I see, wasn't aware of that feature, however:

It's as if it doesn't export the executable, I must do F11 instead of (Ctrl-)F9 when I want it to update the executable. Which is what I want to prevent.
Also, when I change a header file, all projects that include the header or link to the library say that the target it up to date (including the project in question, of course).
Check out my website: http://www.daevius.com

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Smarter compiling
« Reply #3 on: March 28, 2010, 11:54:00 pm »
It works for me, if the library project is chosen in the main projects "Properties -> Project settings -> Project's dependencies" (this makes ure the lib is uptodate if I build main project and if "Properties -> Build targets -> Dependencies -> External dependency files" for the appropriate target is set to the output-file of the library (to make sure my main project is updated/relinked if the libryr has changed).

If an included header is changed and saved, my main project will also be updated.