第一步、远程连接arm
打开vs2019 选择 【工具】-->【选项】-->【跨平台】连接远程arm
第二步、选择编译器
添加linux -GCC编译器
第三步、选择好后配置JSON文件
{
"name": "Linux-GCC-Release",
"generator": "Unix Makefiles",
"configurationType": "Release",
"cmakeExecutable": "/usr/bin/cmake", //cmake的路径
"remoteCopySourcesExclusionList": [ ".vs", "x64", "x64_visionlab", "extern/x86_64_win" ],
"cmakeCommandArgs": "-j 4 chdir \"build\" cmake -DBENCHMARK_DOWNLOAD_DEPENDENCIES=on", //编译选项 高亮的部分是我编译Googlebenchmark的编译选项
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "linux_x64" ],
"remoteMachineName": "10.1.xx.xx",
"remoteCMakeListsRoot": "/home/luster/Downloads/benchmmarkR/pro",
"remoteBuildRoot": "/home/luster/Downloads/benchmmarkR/build",
//远程arm的编译目录 cmake 编译的结果
"remoteInstallRoot": "/home/luster/Downloads/benchmmarkR/install",
"remoteCopySources": true,
"rsyncCommandArgs": "-t --delete --delete-excluded",
"remoteCopyBuildOutput": false,
"remoteCopySourcesMethod": "rsync"
}
第四步、进行Cmake远程编译
第五步、开始编译
以上完成后就可以按照一般的方式对cmake跨平台的代码在远程arm上进行编译了,接下来会复制当前工程到远程arm 上,进行编译。在json配置的arm文件夹下就可以看到编译的结果了。