User forums > Using Code::Blocks

I would like to add src files to the proj without building ALL of them!

<< < (2/3) > >>

Krice:

--- Quote from: andycc57 on November 29, 2013, 03:31:28 am ---How can I change which files get built?
--- End quote ---

By not including everything in main.cpp. Instead use correct C++ programming, including header files in cpp files that need them. That way C::B will compile only changed files.

oBFusCATed:

--- Quote from: Krice on November 30, 2013, 11:28:28 am ---By not including everything in main.cpp. Instead use correct C++ programming, including header files in cpp files that need them. That way C::B will compile only changed files.

--- End quote ---
Your comment is not constructive!
The OP might have his reasons to do what he is trying to do.

For example I know that SQLite people has a mode for building in this way and they gain some performance from it
(because the compiler can see all the function and do its magic).

Krice:

--- Quote from: oBFusCATed on November 30, 2013, 11:52:43 am ---For example I know that SQLite people has a mode for building in this way and they gain some performance from it (because the compiler can see all the function and do its magic).
--- End quote ---

Please explain more about this magic. How doesn't compiler "see" all functions in any cases?

stahta01:

--- Quote from: Krice on November 30, 2013, 10:34:44 pm ---
--- Quote from: oBFusCATed on November 30, 2013, 11:52:43 am ---For example I know that SQLite people has a mode for building in this way and they gain some performance from it (because the compiler can see all the function and do its magic).
--- End quote ---

Please explain more about this magic. How doesn't compiler "see" all functions in any cases?

--- End quote ---

Likely code optimization is made easier by seeing all the code at once.
But, the main reason I think SQLite uses a single effective c/c++ file is ease of use is improved for some cases.

Tim S.
 

oBFusCATed:

--- Quote from: Krice on November 30, 2013, 10:34:44 pm ---Please explain more about this magic. How doesn't compiler "see" all functions in any cases?

--- End quote ---
The compiler can optimize better, because it sees all functions and code, so it can do better inlining, const propagation, etc. You get the same benefits like with the newer -flto flag.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version