port to crafter.build v2
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b38866b55e
commit
4631c18c31
4 changed files with 46 additions and 37 deletions
24
project.cpp
Normal file
24
project.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||
Configuration cfg;
|
||||
cfg.path = "./";
|
||||
cfg.name = "Crafter.Thread";
|
||||
cfg.outputName = "Crafter.Thread";
|
||||
cfg.type = ConfigurationType::LibraryStatic;
|
||||
ApplyStandardArgs(cfg, args);
|
||||
|
||||
std::array<fs::path, 2> ifaces = {
|
||||
"interfaces/Crafter.Thread",
|
||||
"interfaces/Crafter.Thread-ThreadPool",
|
||||
};
|
||||
std::array<fs::path, 1> impls = {
|
||||
"implementations/Crafter.Thread-ThreadPool",
|
||||
};
|
||||
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
||||
|
||||
return cfg;
|
||||
}
|
||||
33
project.json
33
project.json
|
|
@ -1,33 +0,0 @@
|
|||
{
|
||||
"name": "crafter-thread",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "lib",
|
||||
"interfaces": ["interfaces/Crafter.Thread", "interfaces/Crafter.Thread-ThreadPool"],
|
||||
"implementations": ["implementations/Crafter.Thread-ThreadPool"],
|
||||
"type":"library"
|
||||
},
|
||||
{
|
||||
"name": "lib-shared",
|
||||
"extends": ["lib"],
|
||||
"type":"shared-library"
|
||||
},
|
||||
{
|
||||
"name": "lib-debug",
|
||||
"extends": ["lib"],
|
||||
"debug": true
|
||||
}
|
||||
],
|
||||
"tests":[
|
||||
{
|
||||
"name": "should-compile",
|
||||
"implementations": ["tests/ShouldCompile/ShouldCompile"],
|
||||
"dependencies": [
|
||||
{
|
||||
"path":"./project.json",
|
||||
"configuration":"lib-shared"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -20,10 +20,8 @@ import Crafter.Thread;
|
|||
import std;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" {
|
||||
std::string* RunTest() {
|
||||
return nullptr;
|
||||
}
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
20
tests/ShouldCompile/project.cpp
Normal file
20
tests/ShouldCompile/project.cpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||
Configuration cfg;
|
||||
cfg.path = "tests/ShouldCompile/";
|
||||
cfg.name = "ShouldCompile";
|
||||
cfg.outputName = "ShouldCompile";
|
||||
cfg.type = ConfigurationType::Executable;
|
||||
ApplyStandardArgs(cfg, args);
|
||||
cfg.dependencies = { ParentLib("Crafter.Thread") };
|
||||
|
||||
std::array<fs::path, 0> ifaces = {};
|
||||
std::array<fs::path, 1> impls = { "ShouldCompile" };
|
||||
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
||||
|
||||
return cfg;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue