Skip to content

building: DefineGroup not support LIBRARY with LOCAL FLAGS #4417

Open
@leebaok

Description

@leebaok

Description:

when use LIBRARY in DefineGroup with LOCAL FLAGS in SConscript, like:

group = DefineGroup('tensorflow-lite-for-mcu', src, depend = ['USING_TENSORFLOWLITEMICRO'], CPPPATH = CPPPATH, LOCAL_CPPDEFINES = CPPDEFINES, LIBRARY = True)

it will cause two actions:

scons: *** Two environments with different actions were specified for the same target: /Users/libao/Projects/myrtt/xuos-intelligence/framework/tensorflow-lite/tensorflow-lite-for-mcu/source/tensorflow/lite/micro/all_ops_resolver.o
(action 1: arm-none-eabi-g++ -o all_ops_resolver.o -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -std=c++11 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -DHAVE_CCONFIG_H -DSTM32F407xx -D__RTTHREAD__ -DRT_USING_NEWLIB -DUSE_HAL_DRIVER all_ops_resolver.cc)
(action 2: arm-none-eabi-g++ -o all_ops_resolver.o -c -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -std=c++11 -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections -Dgcc -O0 -gdwarf-2 -g -DHAVE_CCONFIG_H -DSTM32F407xx -D__RTTHREAD__ -DRT_USING_NEWLIB -DUSE_HAL_DRIVER -DCMSIS_NN all_ops_resolver.cc)

Analyse

in tools/building.py, DefineGroup return Env.Library to objs and library source files will not be removed from objs. and then in DoBuilding, when call local_group, library source files action conflict with default Environment.

Maybe need to set a new Environment for Library.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions