Esempio n. 1
0
    def saveVars(self):
        vars = {
            'sourcePath': self.sourcePath,
            'buildPath': self.buildPath,
            'originalCwd': self.originalCwd,
            'options': self.options,
            'args': self.args
        }

        # Save any environment variables that are relevant to the build.
        env = {}

        if self.compiler is not None:
            # Save env vars that will be needed to reconfigure.
            for key in self.compiler.EnvVars:
                if key in os.environ:
                    env[key] = os.environ[key]

            # Save any extra compiler info that must be communicated to the backend.
            compilers = [
                ('cc', self.compiler.cc),
                ('cxx', self.compiler.cxx),
            ]
            for prefix, comp in compilers:
                for prop_name in comp.extra_props:
                    key = '{0}_{1}'.format(prefix, prop_name)
                    vars[key] = comp.extra_props[prop_name]

        vars['env'] = env

        with open(os.path.join(self.cacheFolder, 'vars'), 'wb') as fp:
            util.DiskPickle(vars, fp)
Esempio n. 2
0
    def saveVars(self):
        vars = {
            'sourcePath': self.cm.sourcePath,
            'buildPath': self.cm.buildPath,
            'originalCwd': self.cm.originalCwd,
            'options': self.cm.options,
            'args': self.cm.args
        }

        # Save env vars that will be needed to reconfigure.
        env = {}
        for key in ['CC', 'CXX', 'CFLAGS', 'CXXFLAGS']:
            if key in os.environ:
                env[key] = os.environ[key]
        vars['env'] = env

        self.copyBuildVars(vars)

        with open(os.path.join(self.cacheFolder, 'vars'), 'wb') as fp:
            util.DiskPickle(vars, fp)
Esempio n. 3
0
 def postGenerate(self):
     self.generateProjects()
     with open(self.cacheFile, 'wb') as fp:
         util.DiskPickle(self.vars_, fp)