如何将全局 CXX 编译器标志添加到 yocto 构建 [英] How to add global CXX compiler flag to yocto build
本文介绍了如何将全局 CXX 编译器标志添加到 yocto 构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这对我来说似乎很明显,但我找不到任何解决方案.假设我想添加或更改适用于所有 yocto 配方的编译器标志/选项.可以在某处添加全局标志而不更改配方吗?
It seems something obvious to me, but I couldn't find any solution. Suppose I want to add or change a compiler flag/option which applies to all yocto recipes. It is possible to add a global flag somewhere, without changing the recipes ?
推荐答案
您可以在 poky/meta/conf/bitbake.conf 中为 Yocto 构建添加全局编译器选项.添加选项后,使用命令bitbake -e
You can add global compiler options for Yocto builds in poky/meta/conf/bitbake.conf. After adding options, check the bitbake environment using the command bitbake -e
cat poky/meta/conf/bitbake.conf
...
...
##################################################################
# Build flags and options.
##################################################################
export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
BUILDSDK_CPPFLAGS = "-isystem${STAGING_INCDIR}"
export CPPFLAGS = "${TARGET_CPPFLAGS}"
export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION}"
export CFLAGS = "${TARGET_CFLAGS}"
export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
export CXXFLAGS = "${TARGET_CXXFLAGS}"
export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
这篇关于如何将全局 CXX 编译器标志添加到 yocto 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文