Crafter.Build/tests/ProjectDependency/fixture/static-dep/project.cpp

22 lines
704 B
C++
Raw Permalink Normal View History

// SPDX-License-Identifier: LGPL-3.0-only
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
import std;
import Crafter.Build;
#pragma crafter dependency "../greeter"
using namespace Crafter;
// Asks for its dependency at namespace scope, so the call runs while
// LoadProject dlopens this file, before CrafterBuildProject is called.
namespace {
Configuration* const Greeter = ProjectDependency("greeter");
}
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view>) {
Configuration cfg;
cfg.path = "./";
cfg.name = std::format("static {}", Greeter->name);
cfg.outputName = "static-dep";
cfg.type = ConfigurationType::Executable;
return cfg;
}