forked from platformio/platformio-core
Temporary disabled "CPPDEFINES" which contain space and break PlatformIO IDE Linter
This commit is contained in:
@ -4,6 +4,13 @@ Release Notes
|
|||||||
PlatformIO 2.0
|
PlatformIO 2.0
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
2.8.4 (2016-02-??)
|
||||||
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Temporary disabled ``CPPDEFINES`` which contain space and break PlatformIO
|
||||||
|
IDE Linter
|
||||||
|
(`IDE issue #34 <https://github.com/platformio/platformio-atom-ide/issues/34>`_)
|
||||||
|
|
||||||
2.8.3 (2016-02-02)
|
2.8.3 (2016-02-02)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (2, 8, 3)
|
VERSION = (2, 8, "4.dev0")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -141,27 +141,27 @@ def DumpIDEData(env):
|
|||||||
|
|
||||||
BOARD_CORE = env.get("BOARD_OPTIONS", {}).get("build", {}).get("core")
|
BOARD_CORE = env.get("BOARD_OPTIONS", {}).get("build", {}).get("core")
|
||||||
|
|
||||||
def get_includes():
|
def get_includes(env_):
|
||||||
includes = []
|
includes = []
|
||||||
# includes from used framework and libs
|
# includes from used framework and libs
|
||||||
for item in env.get("VARIANT_DIRS", []):
|
for item in env_.get("VARIANT_DIRS", []):
|
||||||
if "$BUILDSRC_DIR" in item[0]:
|
if "$BUILDSRC_DIR" in item[0]:
|
||||||
continue
|
continue
|
||||||
includes.append(env.subst(item[1]))
|
includes.append(env_.subst(item[1]))
|
||||||
|
|
||||||
# custom includes
|
# custom includes
|
||||||
for item in env.get("CPPPATH", []):
|
for item in env_.get("CPPPATH", []):
|
||||||
if item.startswith("$BUILD_DIR"):
|
if item.startswith("$BUILD_DIR"):
|
||||||
continue
|
continue
|
||||||
includes.append(env.subst(item))
|
includes.append(env_.subst(item))
|
||||||
|
|
||||||
# installed libs
|
# installed libs
|
||||||
for d in env.get("LIBSOURCE_DIRS", []):
|
for d in env_.get("LIBSOURCE_DIRS", []):
|
||||||
lsd_dir = env.subst(d)
|
lsd_dir = env_.subst(d)
|
||||||
_append_lib_includes(lsd_dir, includes)
|
_append_lib_includes(env_, lsd_dir, includes)
|
||||||
|
|
||||||
# includes from toolchain
|
# includes from toolchain
|
||||||
toolchain_dir = env.subst(
|
toolchain_dir = env_.subst(
|
||||||
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN"))
|
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN"))
|
||||||
toolchain_incglobs = [
|
toolchain_incglobs = [
|
||||||
join(toolchain_dir, "*", "include*"),
|
join(toolchain_dir, "*", "include*"),
|
||||||
@ -172,19 +172,19 @@ def DumpIDEData(env):
|
|||||||
|
|
||||||
return includes
|
return includes
|
||||||
|
|
||||||
def _append_lib_includes(libs_dir, includes):
|
def _append_lib_includes(env_, libs_dir, includes):
|
||||||
if not isdir(libs_dir):
|
if not isdir(libs_dir):
|
||||||
return
|
return
|
||||||
for name in env.get("LIB_USE", []) + sorted(listdir(libs_dir)):
|
for name in env_.get("LIB_USE", []) + sorted(listdir(libs_dir)):
|
||||||
if not isdir(join(libs_dir, name)):
|
if not isdir(join(libs_dir, name)):
|
||||||
continue
|
continue
|
||||||
# ignore user's specified libs
|
# ignore user's specified libs
|
||||||
if name in env.get("LIB_IGNORE", []):
|
if name in env_.get("LIB_IGNORE", []):
|
||||||
continue
|
continue
|
||||||
if name == "__cores__":
|
if name == "__cores__":
|
||||||
if isdir(join(libs_dir, name, BOARD_CORE)):
|
if isdir(join(libs_dir, name, BOARD_CORE)):
|
||||||
_append_lib_includes(
|
_append_lib_includes(
|
||||||
join(libs_dir, name, BOARD_CORE), includes)
|
env_, join(libs_dir, name, BOARD_CORE), includes)
|
||||||
return
|
return
|
||||||
|
|
||||||
include = (
|
include = (
|
||||||
@ -195,16 +195,16 @@ def DumpIDEData(env):
|
|||||||
if include not in includes:
|
if include not in includes:
|
||||||
includes.append(include)
|
includes.append(include)
|
||||||
|
|
||||||
def get_defines():
|
def get_defines(env_):
|
||||||
defines = []
|
defines = []
|
||||||
# global symbols
|
# global symbols
|
||||||
for item in env.get("CPPDEFINES", []):
|
for item in env_.get("CPPDEFINES", []):
|
||||||
if isinstance(item, list):
|
if isinstance(item, list):
|
||||||
item = "=".join(item)
|
item = "=".join(item)
|
||||||
defines.append(env.subst(item).replace('\\"', '"'))
|
defines.append(env_.subst(item).replace('\\"', '"'))
|
||||||
|
|
||||||
# special symbol for Atmel AVR MCU
|
# special symbol for Atmel AVR MCU
|
||||||
board = env.get("BOARD_OPTIONS", {})
|
board = env_.get("BOARD_OPTIONS", {})
|
||||||
if board and board['platform'] == "atmelavr":
|
if board and board['platform'] == "atmelavr":
|
||||||
defines.append(
|
defines.append(
|
||||||
"__AVR_%s__" % board['build']['mcu'].upper()
|
"__AVR_%s__" % board['build']['mcu'].upper()
|
||||||
@ -213,14 +213,23 @@ def DumpIDEData(env):
|
|||||||
)
|
)
|
||||||
return defines
|
return defines
|
||||||
|
|
||||||
|
env_ = env.Clone()
|
||||||
|
|
||||||
|
# TODO tmp fix https://github.com/platformio/platformio-atom-ide/issues/34
|
||||||
|
_new_defines = []
|
||||||
|
for item in env_.get("CPPDEFINES", []):
|
||||||
|
if " " not in item:
|
||||||
|
_new_defines.append(item)
|
||||||
|
env_.Replace(CPPDEFINES=_new_defines)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"defines": get_defines(),
|
"defines": get_defines(env_),
|
||||||
"includes": get_includes(),
|
"includes": get_includes(env_),
|
||||||
"cc_flags": env.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
"cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
||||||
"cxx_flags": env.subst(
|
"cxx_flags": env_.subst(
|
||||||
"$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
"$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
||||||
"cxx_path": where_is_program(
|
"cxx_path": where_is_program(
|
||||||
env.subst("$CXX"), env.subst("${ENV['PATH']}"))
|
env_.subst("$CXX"), env_.subst("${ENV['PATH']}"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
-I{{include}}
|
-I{{include}}
|
||||||
% end
|
% end
|
||||||
% for define in defines:
|
% for define in defines:
|
||||||
-D{{define}}
|
-D{{!define}}
|
||||||
% end
|
% end
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"execPath": "{{ cxx_path.replace("\\", "/") }}",
|
"execPath": "{{ cxx_path.replace("\\", "/") }}",
|
||||||
"gccDefaultCFlags": "-fsyntax-only {{ cc_flags.replace(' -MMD ', ' ') }}",
|
"gccDefaultCFlags": "-fsyntax-only {{! cc_flags.replace(' -MMD ', ' ').replace('"', '\"') }}",
|
||||||
"gccDefaultCppFlags": "-fsyntax-only {{ cxx_flags.replace(' -MMD ', ' ') }}",
|
"gccDefaultCppFlags": "-fsyntax-only {{! cxx_flags.replace(' -MMD ', ' ').replace('"', '\"') }}",
|
||||||
"gccErrorLimit": 15,
|
"gccErrorLimit": 15,
|
||||||
"gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}",
|
"gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}",
|
||||||
"gccSuppressWarnings": false
|
"gccSuppressWarnings": false
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
-I{{include}}
|
-I{{include}}
|
||||||
% end
|
% end
|
||||||
% for define in defines:
|
% for define in defines:
|
||||||
-D{{define}}
|
-D{{!define}}
|
||||||
% end
|
% end
|
Reference in New Issue
Block a user