crafter-build V2
This commit is contained in:
parent
da211d5e46
commit
2a8405cf21
3 changed files with 36 additions and 26 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Crafter®.Event
|
||||
Copyright (C) 2025 Catcrafts®
|
||||
Copyright (C) 2026 Catcrafts®
|
||||
catcrafts.net
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
|
@ -268,6 +268,7 @@ namespace Crafter {
|
|||
template<typename T> void EventListener<T>::Clear() {
|
||||
if (eventToListenTo != nullptr) {
|
||||
eventToListenTo->RemoveListener(this);
|
||||
eventToListenTo = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -291,6 +292,10 @@ namespace Crafter {
|
|||
eventToListenTo->AddListener(this);
|
||||
}
|
||||
|
||||
EventListener<void>::EventListener() {
|
||||
eventToListenTo = nullptr;
|
||||
}
|
||||
|
||||
EventListener<void>::~EventListener() {
|
||||
if (eventToListenTo != nullptr) {
|
||||
eventToListenTo->RemoveListener(this);
|
||||
|
|
@ -300,10 +305,7 @@ namespace Crafter {
|
|||
void EventListener<void>::Clear() {
|
||||
if (eventToListenTo != nullptr) {
|
||||
eventToListenTo->RemoveListener(this);
|
||||
}
|
||||
}
|
||||
|
||||
EventListener<void>::EventListener() {
|
||||
eventToListenTo = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
project.cpp
Normal file
29
project.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import std;
|
||||
import Crafter.Build;
|
||||
namespace fs = std::filesystem;
|
||||
using namespace Crafter;
|
||||
|
||||
extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> args) {
|
||||
bool debug = false;
|
||||
bool timing = false;
|
||||
std::string target = "x86_64-pc-linux-gnu";
|
||||
for (std::string_view arg : args) {
|
||||
if (arg == "--debug") debug = true;
|
||||
else if (arg == "--timing") timing = true;
|
||||
else if (arg.starts_with("--target=")) target = std::string(arg.substr(std::string_view("--target=").size()));
|
||||
}
|
||||
|
||||
Configuration cfg;
|
||||
cfg.path = "./";
|
||||
cfg.name = "Crafter.Event";
|
||||
cfg.outputName = "Crafter.Event";
|
||||
cfg.target = target;
|
||||
cfg.type = ConfigurationType::LibraryStatic;
|
||||
cfg.debug = debug;
|
||||
if (timing) cfg.defines.push_back({"CRAFTER_TIMING", ""});
|
||||
|
||||
std::array<fs::path, 1> ifaces = { "interfaces/Crafter.Event" };
|
||||
std::array<fs::path, 0> impls = {};
|
||||
cfg.GetInterfacesAndImplementations(ifaces, impls);
|
||||
return cfg;
|
||||
}
|
||||
21
project.json
21
project.json
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"name": "crafter-event",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "lib",
|
||||
"interfaces": ["interfaces/Crafter.Event"],
|
||||
"type":"library"
|
||||
|
||||
},
|
||||
{
|
||||
"name": "lib-timing",
|
||||
"extends": ["lib"],
|
||||
"defines": [{ "name": "CRAFTER_TIMING" }]
|
||||
},
|
||||
{
|
||||
"name": "lib-debug",
|
||||
"debug" : true,
|
||||
"extends": ["lib"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue