xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.87k stars 776 forks source link

引用外部库时如何使用预编译头文件的功能 #5354

Closed TOMO-CAT closed 2 months ago

TOMO-CAT commented 2 months ago

你在什么场景下需要该功能?

当前官方文档对于头文件预编译的内容比较简略: image 假设我需要引用多个 package 的多个头文件,我希望这些头文件都能预编译,现在应该怎么做呢?

描述可能的解决方案

暂无

描述你认为的候选方案

No response

其他信息

No response

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: How to use the function of precompiled header files when referencing external libraries

In what scenario do you need this feature?

The current official documentation is relatively brief on the content of header file precompilation: image Suppose I need to reference multiple header files from multiple packages. I want these header files to be precompiled. What should I do now?

Describe possible solutions

None

Describe your alternatives

No response

other information

No response

waruqi commented 2 months ago

自己搞个 header.h 去 include 所有你想要预编译的 headers 然后把这个 header.h 做成预编译 不就好了么。

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Wouldn't it be nice to make your own header.h to include all the headers you want to precompile, and then make this header.h precompiled?

TOMO-CAT commented 2 months ago

自己搞个 header.h 去 include 所有你想要预编译的 headers 然后把这个 header.h 做成预编译 不就好了么。

好的,我看看 xmake test 里的例子。

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Make your own header.h to include all the headers you want to precompile, and then make this header.h precompiled. Wouldn’t it be great?

So if n files each take x minutes to compile, can combining them into one achieve concurrent compilation, or does it take x * n minutes?