Xmake adds automatic header file dependency detection support

2016/07/12 09:19
Reading 710

In order to further improve the construction efficiency and reduce unnecessary reconstruction, xmake adds dependency detection on header files, and automatically builds source files that only need to be recompiled, improves the compilation speed, and fully supports most platforms such as windows, linux, and macosx..

Since the detection process itself also has some performance losses, xmake has deeply optimized this to achieve fast dependency detection:

  • Filter the dependency header files. If it is a system header file, a third-party header file that is not its own project, it will be automatically ignored. When these header files are basically not used to develop projects, they often change, so there is no need to detect them every time. If there is any change, it is OK to manually rebuild them

  • Cache the detection results of each header file and directly apply them to the next source file to reduce the number of repeated detection

  • Other details optimization

Verification effect:

Take tbox as an example. I manually modified the regular header file in the next tbox: regex.h

Then compile (Note: not to perform reconstruction, but to xmake -r

 xmake

Compilation result:

 [00%]: ccache compiling.release src/tbox/tbox.c [15%]: ccache compiling.release src/tbox/memory/impl/prefix.c [36%]: ccache compiling.release src/tbox/regex/regex.c [50%]: archiving.release libtbox.a ...

Only three of the include files have been compiled to use the source files of regex. h.

Of course, if you modify the header file of the third-party library you depend on, you'd better rebuild it manually:

 xmake -r or xmake --rebuild

Expand to read the full text
Loading
Click to lead the topic 📣 Post and join the discussion 🔥
Reward
zero comment
zero Collection
zero fabulous
 Back to top
Top