Some of the features used in this section are still under development. While they are recommended and usable, and we will try not to break them in future releases, some breaking changes might still occur.
Available since: 1.61.0
SConsDeps is the dependency generator for SCons. It will
generate a SConscript_conandeps file containing the necessary information for SCons to
build against the desired dependencies.
SConsDeps generator can be used by name in conanfiles:
from conan import ConanFile class Pkg(ConanFile): generators = "SConsDeps"
It can also be fully instantiated in the conanfile
from conan import ConanFile from conan.tools.scons import SConsDeps class App(ConanFile): settings = "os", "arch", "compiler", "build_type" def generate(self): tc = SConsDeps(self) tc.generate()
After executing the
conan install command, the
SConsDeps generator will create the
SConscript_conandeps file. This file will provide the following information for SCons:
LINKFLAGS. This information
is generated for the accumulated list of all dependencies and also for each one of the
requirements. You can load it in your consumer SConscript like this:
... info = SConscript('./SConscript_conandeps') # You can use conandeps to get the information # for all the dependencies. flags = info["conandeps"] # Or use the name of the requirement if # you only want the information about that one. flags = info["zlib"] env.MergeFlags(flags) ...