@@ -21,6 +21,7 @@ Copyright: Copyright (C) 2024 Miguel Barro *cpptags-copyright*
21214. Usage.............................................: | cpptags-usage |
2222 REQUIRED TAG GENERATION OPTIONS...............: | cpptags-options |
2323 NEW TAG SYNTAX................................: | cpptags-syntax |
24+ 5. Compiler plugins..................................: | cpptags-compiler |
2425
2526==============================================================================
26272. Motivation *cpptags-motivation*
@@ -204,3 +205,41 @@ All the above rules can be combined together, for example in: >
204205 the command: >
205206 :tag A::B::m<true>(int)
206207 will match case b which is the result of combining the rules above.
208+
209+ ==============================================================================
210+ 5. Compiler plugins *cpptags-compiler*
211+
212+ For convenience some extra compiler plugins are bundled:
213+ • `cmake_msvc` which sets up | 'errorformat' | for Visual C/C++ compiler ouput.
214+ • `cmake _gcc` which sets up | 'errorformat' | for gcc/c++ compiler ouput.
215+
216+ In the plugis the | 'makeprg' | is set up plainly as `cmake` . Thus, | :make | will
217+ require arguments, at least the `-- build` one.
218+
219+ Note that using `cmake` to compile requires two stages:
220+
221+ • Generator stage to create the project native files associated with the
222+ selected generator. >sh
223+ $ cmake -B <binary-path> <source-path>
224+ < where:
225+ ▪ <binary-path> is the folder where the native project files will
226+ be created.
227+ ▪ <source-path> is the folder where the C/C++ sources are.
228+ This stage must be executed before the | :make | call.
229+
230+ • Build stage where the native tools are called to compile.
231+ This is the one associated with the | :make | call. >sh
232+ $ cmake --build <binary-path>
233+ < With the default plugin set up for | 'makeprg' | the call would be: >vim
234+ :make --build <binary-path>
235+
236+ Is convenient to customize | 'makeprg' | to match specific use cases.
237+ For example, is possible to run `cmake` onto `wsl2` from a `vim ` instance
238+ running on the windows host. >
239+ :let &makeprg = "wsl cmake --build <binary-path> *>&1 \\| \\\% { $_ -replace '/mnt/c', 'C:' }"
240+ In this case `vim ` is using `powershell` as shell (see | dos-powershell | ) and
241+ the source path files referenced in the compiler output must be translated back
242+ to windows host paths (otherwise traversal of the list of errors would not
243+ work).
244+
245+ vim:tw=78:ts=8:noet:ft=help:norl:
0 commit comments