forked from platformio/platformio-core
Export `LIBS
,
LIBPATH
, and
LINKFLAGS
` data from project dependent libraries to the global build environment
This commit is contained in:
@ -7,7 +7,10 @@ PlatformIO 3.0
|
|||||||
3.5.4 (2018-??-??)
|
3.5.4 (2018-??-??)
|
||||||
~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Don't export ``CPPPATH`` of project dependent libraries to frameworks
|
* Export ``LIBS``, ``LIBPATH``, and ``LINKFLAGS`` data from project dependent
|
||||||
|
libraries to the global build environment
|
||||||
|
* Don't export ``CPPPATH`` data of project dependent libraries to framework's
|
||||||
|
build environment
|
||||||
(`issue #1665 <https://github.com/platformio/platformio-core/issues/1665>`_)
|
(`issue #1665 <https://github.com/platformio/platformio-core/issues/1665>`_)
|
||||||
* Handle "architectures" data from "library.properties" manifest in
|
* Handle "architectures" data from "library.properties" manifest in
|
||||||
`lib_compat_mode = strict <http://docs.platformio.org/en/page/librarymanager/ldf.html#compatibility-mode>`__
|
`lib_compat_mode = strict <http://docs.platformio.org/en/page/librarymanager/ldf.html#compatibility-mode>`__
|
||||||
|
@ -824,7 +824,7 @@ def GetLibBuilders(env): # pylint: disable=too-many-branches
|
|||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
def BuildProjectLibraries(env):
|
def ConfigureProjectLibBuilder(env):
|
||||||
|
|
||||||
def correct_found_libs(lib_builders):
|
def correct_found_libs(lib_builders):
|
||||||
# build full dependency graph
|
# build full dependency graph
|
||||||
@ -879,8 +879,7 @@ def BuildProjectLibraries(env):
|
|||||||
else:
|
else:
|
||||||
print "No dependencies"
|
print "No dependencies"
|
||||||
|
|
||||||
libs = project.build()
|
return project
|
||||||
return dict(LIBS=libs, CPPPATH=project.env.get("CPPPATH"))
|
|
||||||
|
|
||||||
|
|
||||||
def exists(_):
|
def exists(_):
|
||||||
@ -889,5 +888,5 @@ def exists(_):
|
|||||||
|
|
||||||
def generate(env):
|
def generate(env):
|
||||||
env.AddMethod(GetLibBuilders)
|
env.AddMethod(GetLibBuilders)
|
||||||
env.AddMethod(BuildProjectLibraries)
|
env.AddMethod(ConfigureProjectLibBuilder)
|
||||||
return env
|
return env
|
||||||
|
@ -42,9 +42,16 @@ def scons_patched_match_splitext(path, suffixes=None):
|
|||||||
|
|
||||||
|
|
||||||
def _build_project_deps(env):
|
def _build_project_deps(env):
|
||||||
deps = env.BuildProjectLibraries()
|
project_lib_builder = env.ConfigureProjectLibBuilder()
|
||||||
# prepend dependent libs before built-in
|
|
||||||
env.Prepend(LIBS=deps['LIBS'])
|
# append project libs to the beginning of list
|
||||||
|
env.Prepend(LIBS=project_lib_builder.build())
|
||||||
|
# append extra linker related options from libs
|
||||||
|
env.AppendUnique(
|
||||||
|
**{
|
||||||
|
key: project_lib_builder.env.get(key)
|
||||||
|
for key in ("LIBS", "LIBPATH", "LINKFLAGS")
|
||||||
|
})
|
||||||
|
|
||||||
if "__test" in COMMAND_LINE_TARGETS:
|
if "__test" in COMMAND_LINE_TARGETS:
|
||||||
env.ProcessTest()
|
env.ProcessTest()
|
||||||
@ -57,7 +64,7 @@ def _build_project_deps(env):
|
|||||||
env.get("SRC_FILTER"))
|
env.get("SRC_FILTER"))
|
||||||
|
|
||||||
# CPPPATH from dependencies
|
# CPPPATH from dependencies
|
||||||
projenv.PrependUnique(CPPPATH=deps['CPPPATH'])
|
projenv.PrependUnique(CPPPATH=project_lib_builder.env.get("CPPPATH"))
|
||||||
# extra build flags from `platformio.ini`
|
# extra build flags from `platformio.ini`
|
||||||
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
projenv.ProcessFlags(env.get("SRC_BUILD_FLAGS"))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user