交叉编译工具链编译代码

DE编译:交叉编译,而不是docker中编译时。

修改CMakePresets.json
对于的preset名字的属性进行关闭,例如:

        {
            "name": "build-i3-by-sdk",
            "binaryDir": "${sourceDir}/build",
            "description": "[deprecated] Setup for the ci on i3",
            "inherits": "default-make",
            "cacheVariables": {
                "VARIANT": "CIVIC174M",
                "ENABLE_ENHANCED_SIRI": "ON",
                "BUILD_TESTING": "OFF",
                "ENABLE_CODE_ANALYSIS": "OFF",
                "ENABLE_CODE_FORMAT": "OFF",
                "ENABLE_DOCS": "OFF",
                "ENABLE_PYTHON_TESTS": "OFF",
                "ENABLE_UNIT_TESTS": "OFF"
            }
        },
cd build/
source /opt/mbient/e220/environment-setup-aarch64-mbient-linux 
#cmake --preset=ci-i3 ..
#make -j16
#sudo make install/strip
#安装de到 /usr/bin/mbient/
cmake --preset=build-i3-by-sdk ..
ninja

DDH编译:交叉编译,而不是docker中编译时。

修改CMakePresets.json
对于的preset名字的属性进行关闭,例如:

        {
            "name": "build-i3-by-sdk",
            "description": "[deprecated] Setup for the ci on i3",
            "inherits": "ci",
            "cacheVariables": {
                "VARIANT": "CIVIC174M",
                "BUILD_TESTING": "OFF",
                "ENABLE_CODE_ANALYSIS": "OFF",
                "ENABLE_CODE_FORMAT": "OFF",
                "ENABLE_DOCS": "OFF",
                "ENABLE_PYTHON_TESTS": "OFF",
                "ENABLE_UNIT_TESTS": "OFF"
            }
        },

根据他的inherits继承,层层查找,找到 “generator”: “Ninja”,
没有 "generator"时,默认是make方式编译,如果是ninja,就用ninja编译。
另外,由于$env{BUILD_DIR}环境变量是空的,没有定义,所以需要写死为build。

        {
            "name": "ci",
            "binaryDir": "${sourceDir}/build",

交叉编译:

source /opt/mbient/e69.0/environment-setup-aarch64-mbient-linux 
cd build/
cmake --preset=build-i3-by-sdk ..
ninja

执行cmake

y@HP:~/test/dialog-manifests/dialog-domain-handlers/build$ cmake --preset=build-i3-by-sdk ..

注意事项

在ddh每次重新cmake之后需要修改ninja配置文件:

/home/sy/test/dialog-manifests/dialog-domain-handlers/build/uild.ninja

文件在39行左右添加

-I/opt/mbient/e66.0-3.0/sysroots/cortexa78c-mbient-linux/usr/include/thriftme

如下所示:

  DEFINES = -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DCIVIC174M -DFMT_LOCALE -DFMT_SHARED -DJSON_DIAGNOSTICS=0 -DJSON_USE_IMPLICIT_CONVERSIONS=1
  DEP_FILE = src/EmbeddedCommon/CommonPhone/mocks/CMakeFiles/CommonPhoneMocks.dir/CommonPhoneSharedMock.cpp.o.d
  FLAGS = -O2 -pipe -g -feliminate-unused-debug-types  -O3 -DNDEBUG "-DBETTER_ENUMS_MACRO_FILE=<enum_macros.h>" -std=c++17
  INCLUDES = -I/opt/mbient/e66.0-3.0/sysroots/cortexa78c-mbient-linux/usr/include/thriftme -I/home/sy/test/dialog-manifests/dialog-domain-handlers/src/EmbeddedCommon/CommonPhone/mocks/.

然后执行ninjia, 等待编译完成,编译完成后,放到台架上查看是否可以运行。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

三月微风

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值