Skip to content

SConscript生成多余文件导致mdk内编译失败 #2

@letiannn

Description

@letiannn
#SConscript 当前状态
import os
from building import *

cwd = GetCurrentDir()

CPPPATH = [
    cwd,
    os.path.join(cwd, 'isotp-c')
]

sources = Glob('*.c') + Glob('isotp-c/*.c')

group = DefineGroup('isotp-c', sources, depend=[''], CPPPATH=CPPPATH)

if GetDepend('PKG_ISOTP_C_EXAMPLES'):
    example_sources = Glob('examples/isotp_examples.c')

    example_group = DefineGroup('isotp-c_example', example_sources, depend=[''], CPPPATH=CPPPATH)

    group += example_group

Return('group')

错误状态:
Image

修改SConscript文件后

#SConscript
from building import *
import os

cwd = GetCurrentDir()
path = [cwd, cwd + 'isotp-c']
CPPPATH = path

src = Glob('*.c') + Glob('isotp-c/*.c')

if GetDepend('PKG_ISOTP_C_EXAMPLES'):
    src += Glob('examples/*.c')

group = []
group = group + DefineGroup('isotp-c', src, depend = [''], CPPPATH = CPPPATH)

Return('group')

未报错
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions