def extend(cpp_info, config): """ adds the specific config configuration to the common one """ config_info = cpp_info.configs.get(config) if config_info: def add_lists(seq1, seq2): return seq1 + [s for s in seq2 if s not in seq1] result = CppInfo(str(config_info), config_info.rootpath) result.filter_empty = cpp_info.filter_empty result.includedirs = add_lists(cpp_info.includedirs, config_info.includedirs) result.libdirs = add_lists(cpp_info.libdirs, config_info.libdirs) result.bindirs = add_lists(cpp_info.bindirs, config_info.bindirs) result.resdirs = add_lists(cpp_info.resdirs, config_info.resdirs) result.builddirs = add_lists(cpp_info.builddirs, config_info.builddirs) result.libs = cpp_info.libs + config_info.libs result.defines = cpp_info.defines + config_info.defines result.cflags = cpp_info.cflags + config_info.cflags result.cxxflags = cpp_info.cxxflags + config_info.cxxflags result.sharedlinkflags = cpp_info.sharedlinkflags + config_info.sharedlinkflags result.exelinkflags = cpp_info.exelinkflags + config_info.exelinkflags result.system_libs = add_lists(cpp_info.system_libs, config_info.system_libs) result.build_modules = merge_dicts(cpp_info.build_modules, config_info.build_modules) return result return cpp_info
def extend(cpp_info, config): """ adds the specific config configuration to the common one """ config_info = cpp_info.configs.get(config) if config_info: result = CppInfo(config_info.rootpath) result.includedirs = cpp_info.includedirs + config_info.includedirs result.libdirs = cpp_info.libdirs + config_info.libdirs result.bindirs = cpp_info.bindirs + config_info.bindirs result.resdirs = cpp_info.resdirs + config_info.resdirs result.builddirs = cpp_info.builddirs + config_info.builddirs result.libs = cpp_info.libs + config_info.libs result.defines = cpp_info.defines + config_info.defines result.cflags = cpp_info.cflags + config_info.cflags result.cppflags = cpp_info.cppflags + config_info.cppflags result.sharedlinkflags = cpp_info.sharedlinkflags + config_info.sharedlinkflags result.exelinkflags = cpp_info.exelinkflags + config_info.exelinkflags return result return cpp_info