improve toptica::c-make
This commit is contained in:
parent
c3d483312c
commit
fe1588978c
@ -186,6 +186,7 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
let g:SshOpts = ""
|
let g:SshOpts = ""
|
||||||
let g:SshOpts2 = ""
|
let g:SshOpts2 = ""
|
||||||
execute 'set path+=' . g:GccRoot . s:oselas_include
|
execute 'set path+=' . g:GccRoot . s:oselas_include
|
||||||
|
let $PATH = $PATH.':'.g:GccRoot.'/bin'
|
||||||
" let g:ycm_clangd_args = ['-I'.g:GccRoot . s:oselas_include]
|
" let g:ycm_clangd_args = ['-I'.g:GccRoot . s:oselas_include]
|
||||||
elseif (g:project_type == 'topmode-gui')
|
elseif (g:project_type == 'topmode-gui')
|
||||||
let s:Program = '/TOPAS_Topmode'
|
let s:Program = '/TOPAS_Topmode'
|
||||||
@ -281,10 +282,15 @@ function s:ProjectSet(project_type, project_base_dir)
|
|||||||
command! -nargs=? MakeCheck call s:MakeCheck('<args>', 0)
|
command! -nargs=? MakeCheck call s:MakeCheck('<args>', 0)
|
||||||
|
|
||||||
" cmake
|
" cmake
|
||||||
command! -nargs=1 -complete=custom,CmakeBuildTypes Cmake call s:Cmake('<args>', 0)
|
command! -nargs=* -complete=custom,CmakeBuildTypes Cmake call s:Cmake('<args>', 0)
|
||||||
function! CmakeBuildTypes(ArgLead, CmdLine, CorsorPos)
|
function! CmakeBuildTypes(ArgLead, CmdLine, CorsorPos)
|
||||||
return join(['Debug', 'RelWithDebInfo'], "\n")
|
return join([
|
||||||
" return join(['Debug', 'RelWithDebInfo', '-DHARDWARE_DLCSMART=ON'], "\n")
|
\'-DCMAKE_BUILD_TYPE=Debug',
|
||||||
|
\'-DCMAKE_BUILD_TYPE=RelWithDebInfo',
|
||||||
|
\'-DHARDWARE_DLCSMART=ON',
|
||||||
|
\'-DMOCK_ALL_CAN_DEVICES=ON',
|
||||||
|
\'-DUNIT_TESTING',
|
||||||
|
\], "\n")
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" configure quickfix window for asyncrun
|
" configure quickfix window for asyncrun
|
||||||
@ -344,7 +350,7 @@ endfunction
|
|||||||
function s:MakeTestBuild()
|
function s:MakeTestBuild()
|
||||||
let &makeprg = s:makeprg
|
let &makeprg = s:makeprg
|
||||||
call s:BuildDirStash('save')
|
call s:BuildDirStash('save')
|
||||||
call s:Cmake('Release', 1)
|
call s:Cmake('-DCMAKE_BUILD_TYPE=Release', 1)
|
||||||
call s:Make('-j4 device-control artifacts doxygen user-interface', 1)
|
call s:Make('-j4 device-control artifacts doxygen user-interface', 1)
|
||||||
call s:BuildDirStash('release-test')
|
call s:BuildDirStash('release-test')
|
||||||
call s:BuildDirUnStash('save')
|
call s:BuildDirUnStash('save')
|
||||||
@ -364,12 +370,11 @@ function s:MakeCheck(filename, async_mode)
|
|||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -program=make -cwd='.g:ProjectBuildDir. ' @ '.args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function s:Cmake(build_type, async_mode)
|
function s:Cmake(options, async_mode)
|
||||||
if !isdirectory(g:ProjectBuildDir)
|
if !isdirectory(g:ProjectBuildDir)
|
||||||
call mkdir(g:ProjectBuildDir)
|
call mkdir(g:ProjectBuildDir)
|
||||||
endif
|
endif
|
||||||
execute "!rm ".g:ProjectBuildDir."/build-type*"
|
execute "!rm -f ".g:ProjectBuildDir."/cmake-cmd*"
|
||||||
execute "!touch ".g:ProjectBuildDir."/build-type:".a:build_type
|
|
||||||
call asyncrun#quickfix_toggle(10, 1)
|
call asyncrun#quickfix_toggle(10, 1)
|
||||||
let args = ""
|
let args = ""
|
||||||
let args .= " ../".g:ProjectSrcDirRel."/"
|
let args .= " ../".g:ProjectSrcDirRel."/"
|
||||||
@ -377,7 +382,7 @@ function s:Cmake(build_type, async_mode)
|
|||||||
let args .= "/targets/simulator"
|
let args .= "/targets/simulator"
|
||||||
endif
|
endif
|
||||||
let args .= " --graphviz=dependencies.dot"
|
let args .= " --graphviz=dependencies.dot"
|
||||||
let args .= " -DCMAKE_BUILD_TYPE=".a:build_type
|
let args .= " ".a:options
|
||||||
let args .= " -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
|
let args .= " -DCMAKE_EXPORT_COMPILE_COMMANDS=1"
|
||||||
if (g:project_type == 'dlcpro')
|
if (g:project_type == 'dlcpro')
|
||||||
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/Toolchain-target.cmake"
|
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/Toolchain-target.cmake"
|
||||||
@ -399,6 +404,7 @@ function s:Cmake(build_type, async_mode)
|
|||||||
elseif (g:project_type == 'decof')
|
elseif (g:project_type == 'decof')
|
||||||
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/ci/Toolchain-dlcpro-target.cmake"
|
let args .= " -DCMAKE_TOOLCHAIN_FILE=../".g:ProjectSrcDirRel."/ci/Toolchain-dlcpro-target.cmake"
|
||||||
endif
|
endif
|
||||||
|
execute '!echo "cmake '.args.'" > ' g:ProjectBuildDir."/cmake_cmd"
|
||||||
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.g:ProjectBuildDir.' @ cmake '.args
|
execute 'AsyncRun -mode='.a:async_mode.' -save=2 -cwd='.g:ProjectBuildDir.' @ cmake '.args
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@ -830,11 +836,11 @@ function s:Jenkins_linter(jenkinsfile)
|
|||||||
endif
|
endif
|
||||||
let user_pass = s:user.":".s:passwd
|
let user_pass = s:user.":".s:passwd
|
||||||
|
|
||||||
let out = system("curl --no-progress-meter --user '".user_pass."' -X POST -F 'jenkinsfile=<".jenkinsfile."' ".g:jenkins_url."/pipeline-model-converter/validate")
|
let l:out = system("curl --no-progress-meter --user '".user_pass."' -X POST -F 'jenkinsfile=<".jenkinsfile."' ".g:jenkins_url."/pipeline-model-converter/validate")
|
||||||
if match(out, "HTTP ERROR 401") >= 0
|
if match(l:out, "HTTP ERROR 401") >= 0
|
||||||
" Forget credentials on authorization error
|
" Forget credentials on authorization error
|
||||||
unlet s:user
|
unlet s:user
|
||||||
unlet s:passwd
|
unlet s:passwd
|
||||||
endif
|
endif
|
||||||
echo out
|
echo l:out
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -72,6 +72,7 @@ set nobackup " keep no backup file
|
|||||||
set history=50 " keep 50 lines of command line history
|
set history=50 " keep 50 lines of command line history
|
||||||
set ruler " show the cursor position all the time
|
set ruler " show the cursor position all the time
|
||||||
set showcmd " display incomplete commands
|
set showcmd " display incomplete commands
|
||||||
|
set belloff=all
|
||||||
|
|
||||||
" filetype detection
|
" filetype detection
|
||||||
filetype on
|
filetype on
|
||||||
|
Loading…
x
Reference in New Issue
Block a user