How can I use a cross compiler with Scons?

后端 未结 1 1987
慢半拍i
慢半拍i 2020-12-02 02:55

Following the advice on the Scons FAQ and from an old mailing list thread, I\'ve built up a really simple SConstruct and SConscript that I thought

1条回答
  •  情歌与酒
    2020-12-02 03:11

    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')
    

    0 讨论(0)
提交回复
热议问题