Пример #1
0
    def test_cross_compile(self):
        plugin = waf.WafPlugin("test-part", self.options, self.project)
        # This shouldn't raise an exception
        plugin.enable_cross_compilation()

        env = plugin.env(plugin.sourcedir)
        self.assertIn("CC={}-gcc".format(self.project.arch_triplet), env)
        self.assertIn("CXX={}-g++".format(self.project.arch_triplet), env)
Пример #2
0
    def waf_build(self):
        """Helper to call a full build"""
        plugin = waf.WafPlugin("test-part", self.options, self.project)
        os.makedirs(plugin.sourcedir)

        # Create fake waf
        open(os.path.join(plugin.sourcedir, "waf"), "w").close()

        plugin.build()

        return plugin
Пример #3
0
def test_cross_compile(monkeypatch, deb_arch):
    monkeypatch.setattr(Project, "is_cross_compiling", True)

    class Options:
        configflags = []

    project = Project(target_deb_arch=deb_arch)
    project._snap_meta = meta.snap.Snap(name="test-snap", base="core18")

    plugin = waf.WafPlugin("test-part", Options(), project)
    plugin.enable_cross_compilation()

    env = plugin.env(plugin.sourcedir)
    assert f"CC={project.arch_triplet}-gcc" in env
    assert f"CXX={project.arch_triplet}-g++" in env