mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
waf: ensure we don't build a library twice
This commit is contained in:
parent
9f84a22d22
commit
fcd7611248
@ -6,6 +6,7 @@ from waflib import Logs, Options, Utils
|
|||||||
from waflib.Build import BuildContext
|
from waflib.Build import BuildContext
|
||||||
from waflib.Configure import conf
|
from waflib.Configure import conf
|
||||||
import os.path, os
|
import os.path, os
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
SOURCE_EXTS = [
|
SOURCE_EXTS = [
|
||||||
'*.S',
|
'*.S',
|
||||||
@ -153,6 +154,10 @@ def _get_next_idx():
|
|||||||
LAST_IDX += 1
|
LAST_IDX += 1
|
||||||
return LAST_IDX
|
return LAST_IDX
|
||||||
|
|
||||||
|
def unique_list(items):
|
||||||
|
'''remove duplicate elements from a list while maintaining ordering'''
|
||||||
|
return list(OrderedDict.fromkeys(items))
|
||||||
|
|
||||||
@conf
|
@conf
|
||||||
def ap_stlib(bld, **kw):
|
def ap_stlib(bld, **kw):
|
||||||
if 'name' not in kw:
|
if 'name' not in kw:
|
||||||
@ -163,7 +168,7 @@ def ap_stlib(bld, **kw):
|
|||||||
bld.fatal('Missing libraries for ap_stlib')
|
bld.fatal('Missing libraries for ap_stlib')
|
||||||
|
|
||||||
sources = []
|
sources = []
|
||||||
libraries = kw['libraries'] + bld.env.AP_LIBRARIES
|
libraries = unique_list(kw['libraries'] + bld.env.AP_LIBRARIES)
|
||||||
|
|
||||||
for lib_name in libraries:
|
for lib_name in libraries:
|
||||||
lib_node = bld.srcnode.find_dir('libraries/' + lib_name)
|
lib_node = bld.srcnode.find_dir('libraries/' + lib_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user