mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Improve include selection for mbed boards with a custom vendor
This commit is contained in:
@ -145,18 +145,24 @@ def add_mbedlib(libname, libar):
|
|||||||
"lwip-sys"
|
"lwip-sys"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_map = {
|
||||||
|
"nxplpc": "NXP",
|
||||||
|
"freescalekinetis": "Freescale",
|
||||||
|
"ststm32": "STM"
|
||||||
|
}
|
||||||
|
|
||||||
|
target_includes = (
|
||||||
|
"TARGET_%s" % target_map.get(
|
||||||
|
env.get("BOARD_OPTIONS", {}).get("platform", ""), ""),
|
||||||
|
"TARGET_%s" % variant,
|
||||||
|
"TARGET_CORTEX_M"
|
||||||
|
)
|
||||||
|
|
||||||
for root, _, files in walk(lib_dir):
|
for root, _, files in walk(lib_dir):
|
||||||
if (not any(f.endswith(".h") for f in files) and
|
if (not any(f.endswith(".h") for f in files) and
|
||||||
basename(root) not in sysincdirs):
|
basename(root) not in sysincdirs):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
target_includes = (
|
|
||||||
"TARGET_%s" % env.get(
|
|
||||||
"BOARD_OPTIONS", {}).get("vendor", "").upper(),
|
|
||||||
"TARGET_%s" % variant,
|
|
||||||
"TARGET_CORTEX_M"
|
|
||||||
)
|
|
||||||
|
|
||||||
if "TARGET_" in root:
|
if "TARGET_" in root:
|
||||||
if all([p not in root.upper() for p in target_includes]):
|
if all([p not in root.upper() for p in target_includes]):
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user