update
This commit is contained in:
parent
d71b9a90a0
commit
9be3ad6bac
@ -1,5 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
|
#include "core.h"
|
||||||
ENGINE_API const char* engine();
|
ENGINE_API const char* engine();
|
||||||
ENGINE_API extern Module engine_module;
|
ENGINE_API extern Module engine_module;
|
||||||
ENGINE_API extern Module engine_module_hello;
|
ENGINE_API extern Module engine_module_hello;
|
||||||
|
|
||||||
|
|||||||
@ -2,4 +2,4 @@
|
|||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
const char* asset();
|
const char* asset();
|
||||||
inline Module asset_module{ asset(), false};
|
//inline Module asset_module{ asset(), false};
|
||||||
@ -1,14 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
const char* core();
|
const char* core();
|
||||||
inline Module core_module{ core(), false};
|
inline Module core_module{ "ssss", false};
|
||||||
struct ModuleManager;
|
|
||||||
struct ModuleManagerPtr {
|
|
||||||
ModuleManager* ptr;
|
|
||||||
ModuleManagerPtr();
|
|
||||||
};
|
|
||||||
CORE_API inline ModuleManagerPtr ms_instance;
|
|
||||||
struct ModuleManager {
|
struct ModuleManager {
|
||||||
ModuleManager();
|
ModuleManager();
|
||||||
static ModuleManager* Ptr();
|
static ModuleManager* Ptr();
|
||||||
};
|
};
|
||||||
|
struct ModuleManagerPtr {
|
||||||
|
public:
|
||||||
|
ModuleManager* ptr;
|
||||||
|
ModuleManagerPtr();
|
||||||
|
};
|
||||||
|
inline int s_ptr;
|
||||||
@ -11,8 +11,8 @@ ModuleManager::ModuleManager()
|
|||||||
|
|
||||||
ModuleManager* ModuleManager::Ptr()
|
ModuleManager* ModuleManager::Ptr()
|
||||||
{
|
{
|
||||||
static ModuleManager module;
|
static ModuleManager manager;
|
||||||
auto* ptr = &module;
|
auto* ptr = &manager;
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,9 @@ struct Detail {
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
int new_count = 0;
|
int new_count = 0;
|
||||||
int del_count = 0;
|
int del_count = 0;
|
||||||
|
Detail() {
|
||||||
|
std::cout << "Detail" << std::endl;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct Module;
|
struct Module;
|
||||||
ZLIB_API inline Detail detail;
|
ZLIB_API inline Detail detail;
|
||||||
|
|||||||
@ -43,5 +43,7 @@ namespace zlog {
|
|||||||
const std::string format_str = fmt::format(std::forward<Args>(args)...);
|
const std::string format_str = fmt::format(std::forward<Args>(args)...);
|
||||||
throw std::runtime_error(format_str);
|
throw std::runtime_error(format_str);
|
||||||
};
|
};
|
||||||
void flush();
|
inline void flush() {
|
||||||
|
zlog.flush();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@ -32,7 +32,4 @@ namespace zlog {
|
|||||||
m_logger->flush();
|
m_logger->flush();
|
||||||
spdlog::drop_all();
|
spdlog::drop_all();
|
||||||
}
|
}
|
||||||
void flush(){
|
|
||||||
zlog.flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#include "api.h"
|
#include "api.h"
|
||||||
ENGINE_API Module engine_module{ engine(), true };
|
ENGINE_API Module engine_module{ engine(), true };
|
||||||
ENGINE_API inline Module engine_module_hello{ "engine_module_hello", true };
|
ENGINE_API Module engine_module_hello{ "engine_module_hello", true };
|
||||||
const char* engine()
|
const char* engine()
|
||||||
{
|
{
|
||||||
return "engine";
|
return "engine";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,8 @@ target("engine")
|
|||||||
add_includedirs("modules/asset/include", {public = true})
|
add_includedirs("modules/asset/include", {public = true})
|
||||||
add_includedirs("modules/core/include", {public = true})
|
add_includedirs("modules/core/include", {public = true})
|
||||||
add_includedirs("modules/zlib/include", {public = true})
|
add_includedirs("modules/zlib/include", {public = true})
|
||||||
add_deps("asset", "zlib", "core", { inherit = false})
|
add_deps("asset", "zlib", "core")
|
||||||
add_rules("engine.api", {inherit = false})
|
add_rules("engine.api")
|
||||||
|
|
||||||
includes("xmake/xmake.lua")
|
includes("xmake/xmake.lua")
|
||||||
includes("modules/*/xmake.lua")
|
includes("modules/*/xmake.lua")
|
||||||
@ -36,26 +36,10 @@ function main(target)
|
|||||||
target:add("links", dep)
|
target:add("links", dep)
|
||||||
local dir = deptarget:targetdir()
|
local dir = deptarget:targetdir()
|
||||||
if not linkdirs[dir] then
|
if not linkdirs[dir] then
|
||||||
target:add("linkdirs", dir)
|
target:add("linkdirs", path.join(os.projectdir(),dir))
|
||||||
linkdirs[dir] = true
|
linkdirs[dir] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- local real_deps = {}
|
|
||||||
-- local links = {}
|
|
||||||
-- for _,dep in ipairs(deps) do
|
|
||||||
-- local deptarget = project.target(dep)
|
|
||||||
-- if deptarget:kind() == "static" then
|
|
||||||
-- add_define(target, dep, is_static)
|
|
||||||
-- --add_packages(target, deptarget)
|
|
||||||
-- table.insert(links, dep)
|
|
||||||
-- elseif is_link then
|
|
||||||
-- table.insert(real_deps, dep)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- if is_link then
|
|
||||||
-- --target:add("links", links)
|
|
||||||
-- --target:set("deps", real_deps)
|
|
||||||
-- end
|
|
||||||
end
|
end
|
||||||
@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "zlib.h"
|
#include "zlib.h"
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "api.h"
|
|
||||||
VULKAN_API const char* vulkan();
|
VULKAN_API const char* vulkan();
|
||||||
inline Module vulkan_module{vulkan(), true};
|
VULKAN_API extern Module vulkan_module;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const char* vulkan()
|
const char* vulkan()
|
||||||
{
|
{
|
||||||
auto c1 = engine_module_hello.name.c_str();
|
|
||||||
auto c2 = zlib_module.name.c_str();
|
|
||||||
return "vulkan";
|
return "vulkan";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,4 @@ target("zworld-editor")
|
|||||||
set_kind("binary")
|
set_kind("binary")
|
||||||
set_group("game")
|
set_group("game")
|
||||||
add_files("src/*.cpp")
|
add_files("src/*.cpp")
|
||||||
add_headerfiles("include/*.h")
|
|
||||||
add_includedirs("include", {public = true})
|
|
||||||
add_deps("zworld", {public = true})
|
add_deps("zworld", {public = true})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user