How can I use a cross compiler with Scons?

白昼怎懂夜的黑 提交于 2019-11-27 09:51:09

You're almost there. You're adding your PATH to the SCons construction environment instead of to the ENV key of the construction environment:

import os

env_options = {
    "CC"    : "nios2-linux-gnu-gcc",
    "CXX"   : "nios2-linux-gnu-g++",
    "LD"    : "nios2-linux-gnu-g++",
    "AR"    : "nios2-linux-gnu-ar",
    "STRIP" : "nios2-linux-gnu-strip",
}

env = Environment(**env_options)
env.Append(ENV = {'PATH' : os.environ['PATH']})
Export('env')
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!