Mercurial > vim-unreal
annotate compiler/ubuild.vim @ 2:9235d8341a18
Refactor the build system invocation commands.
Now we have proper knowledge of the projects inside a codebase ("branch"). The
plugin should correctly parse configuration names, find the correct module to
build based on the configuration, and so on.
Also, added support for generating the clang compilation database.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 22 Jan 2021 16:38:18 -0800 |
parents | ba03cac1b1c6 |
children |
rev | line source |
---|---|
0 | 1 " Compiler file for building Unreal Engine projects |
2 " Compiler: Unreal Build | |
3 " Maintainer: Ludovic Chabant <https://ludovic.chabant.com> | |
4 | |
5 if exists("current_compiler") | |
6 finish | |
7 endif | |
8 let current_compiler = "ubuild" | |
9 | |
10 let s:keepcpo = &cpo | |
11 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
12 let s:scriptname = get(g:, '__unreal_makeprg_script', 'Build') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
13 let s:prgpath = shellescape( |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
14 \unreal#get_script_path("Engine/Build/BatchFiles/".s:scriptname)) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
15 let s:prgargs = map( |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
16 \copy(get(g:, '__unreal_makeprg_args', [])), |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
17 \{idx, val -> escape(val, ' \"')}) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
18 let s:prgcmdline = fnameescape(s:prgpath).'\ '.join(s:prgargs, '\ ') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
19 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
20 call unreal#trace("Setting makeprg to: ".s:prgcmdline) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
21 |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
22 if !get(g:, 'unreal_debug_build', 0) |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
23 execute "CompilerSet makeprg=".s:prgcmdline |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
24 else |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
25 execute "CompilerSet makeprg=echo\\ ".shellescape(s:prgcmdline) |
0 | 26 endif |
27 | |
28 CompilerSet errorformat& | |
29 | |
2
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
30 " Set the MSBuild error format on Windows. |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
31 "if has('win32') || has('win64') |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
32 " execute "CompilerSet errorformat=".vimcrosoft#get_msbuild_errorformat() |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
33 " echom "Set errorformat from vimcrosoft!" |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
34 " echom &errorformat |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
35 "else |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
36 " echom "Not setting error format" |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
37 "endif |
9235d8341a18
Refactor the build system invocation commands.
Ludovic Chabant <ludovic@chabant.com>
parents:
0
diff
changeset
|
38 |
0 | 39 let &cpo = s:keepcpo |
40 unlet s:keepcpo | |
41 |