This question already has an answer here:
这个问题在这里已有答案:
- cmake include header into every source file 1 answer
cmake包含每个源文件的标题1个答案
Is there any way to include a header (.hpp) in all cpp files from a project (automatic)?
有没有办法在项目的所有cpp文件中包含一个标题(.hpp)(自动)?
The project is compiled using cmake.
该项目使用cmake编译。
1 个解决方案
#1
0
You can use pre-compiled headers to that. Cross-compile implementation of that for CMake is not very easy, so, I recommend 3rd party module for that, for example CMakePCHCompiler
您可以使用预编译的标头。用于CMake的交叉编译实现并不是很容易,因此,我推荐使用第三方模块,例如CMakePCHCompiler
#1
0
You can use pre-compiled headers to that. Cross-compile implementation of that for CMake is not very easy, so, I recommend 3rd party module for that, for example CMakePCHCompiler
您可以使用预编译的标头。用于CMake的交叉编译实现并不是很容易,因此,我推荐使用第三方模块,例如CMakePCHCompiler