How avoid rebuild whole library?


#1

I have library conrod and compile example text. Each change in example causes rebuild whole library - 14.5 s. on my Pentium Core i3.


#2

just for clarification, is your project rebuilding or is conrod rebuilding?


#3

If I call : rustc hello_world.rs, it is fast but only I have 125K file which doing nothing
I must:
cargo build --release --features=“winit glium” --example hello_world
which build me conrod
It means: in general it is possible not build library, but how to do with conrod?


#4

I believe because it is a library example and not an external crate, it builds the entire library everytime.

Note: I mostly use cargo so take my response with a grain of salt


#5

To fix this I suppose the only way is to move example to separate crate,
like cargo new --bin example_1 && cd example_1 && cargo add conrod


#6

Compiling with --release is in general slower then compiling without this flag. I don’t think Pentium Core i3 exists


#7

Of course it does:

Along its bigger brothers i5 and i7…


#8

Not Pentium, just Core