update editor
This commit is contained in:
parent
42bd8b06b5
commit
546e7c5c5f
3
engine/3rdparty/xmake.lua
vendored
3
engine/3rdparty/xmake.lua
vendored
@ -1,3 +1,4 @@
|
|||||||
add_requires("spdlog", "lemon", "libsdl", "vulkansdk","shaderc","spirv","spirv-cross")
|
add_requires("spdlog", "lemon", "libsdl", "vulkansdk","shaderc","spirv","spirv-cross")
|
||||||
add_requires("mimalloc", {configs = {shared = true, debug = true}})
|
add_requires("mimalloc", {configs = {shared = true, debug = true, copy = true}})
|
||||||
|
add_requires("imgui",{configs = { shared = false, debug = true, copy = true}})
|
||||||
includes("*/xmake.lua")
|
includes("*/xmake.lua")
|
||||||
@ -1,2 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
EDITOR_API extern int editor_v;
|
|
||||||
12
engine/include/editor/editor.h
Normal file
12
engine/include/editor/editor.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "module/module.h"
|
||||||
|
namespace api {
|
||||||
|
class EDITOR_API EditorModule : public api::IDynamicModule
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void OnLoad(int argc, char** argv) override;
|
||||||
|
void OnUnload() override;
|
||||||
|
void InitMetaData(void) override {};
|
||||||
|
};
|
||||||
|
IMPLEMENT_DYNAMIC_MODULE(EDITOR_API, EditorModule, editor)
|
||||||
|
}
|
||||||
@ -1,2 +0,0 @@
|
|||||||
#include "editor/api.h"
|
|
||||||
int editor_v;
|
|
||||||
14
engine/src/editor/editor.cpp
Normal file
14
engine/src/editor/editor.cpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#include "editor/editor.h"
|
||||||
|
#include "imgui.h"
|
||||||
|
namespace api {
|
||||||
|
void EditorModule::OnLoad(int argc, char** argv)
|
||||||
|
{
|
||||||
|
IMGUI_CHECKVERSION();
|
||||||
|
ImGui::CreateContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EditorModule::OnUnload()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,10 +1,3 @@
|
|||||||
target("editor")
|
|
||||||
set_kind("shared")
|
|
||||||
set_group("Engine")
|
|
||||||
add_rules("engine.api")
|
|
||||||
add_headerfiles("include/editor/*.h")
|
|
||||||
add_includedirs("include")
|
|
||||||
add_files("src/editor/*.cpp")
|
|
||||||
target("engine")
|
target("engine")
|
||||||
add_defines("ENGINE_ROOT="..os.curdir():gsub("\\", "\\\\"),{public = false})
|
add_defines("ENGINE_ROOT="..os.curdir():gsub("\\", "\\\\"),{public = false})
|
||||||
add_headerfiles("include/*.natvis")
|
add_headerfiles("include/*.natvis")
|
||||||
@ -13,6 +6,15 @@ target("engine")
|
|||||||
set_group("Engine")
|
set_group("Engine")
|
||||||
add_rules("engine.api")
|
add_rules("engine.api")
|
||||||
add_files("src/engine/*.cpp")
|
add_files("src/engine/*.cpp")
|
||||||
|
target("editor")
|
||||||
|
set_kind("shared")
|
||||||
|
set_group("Engine")
|
||||||
|
add_rules("engine.api")
|
||||||
|
add_headerfiles("include/editor/*.h")
|
||||||
|
add_includedirs("include")
|
||||||
|
add_files("src/editor/*.cpp")
|
||||||
|
add_packages("imgui",{public = true})
|
||||||
|
add_deps("engine",{public = true})
|
||||||
includes("xmake/xmake.lua")
|
includes("xmake/xmake.lua")
|
||||||
includes("3rdparty/xmake.lua")
|
includes("3rdparty/xmake.lua")
|
||||||
includes("tools/xmake.lua")
|
includes("tools/xmake.lua")
|
||||||
|
|||||||
15
engine/xmake/rule_api/package_api.lua
Normal file
15
engine/xmake/rule_api/package_api.lua
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import("core.project.project")
|
||||||
|
function main(target)
|
||||||
|
for _, pkg in pairs(target:pkgs()) do
|
||||||
|
if pkg:requireconf("configs","copy") then
|
||||||
|
local link = pkg:get("links")
|
||||||
|
local targetdir = target:targetdir()
|
||||||
|
link = link[1] or link
|
||||||
|
if link and not os.isfile(path.join(targetdir, link .. ".lib")) then
|
||||||
|
local linkdirs = pkg:get("linkdirs")
|
||||||
|
os.trycp(linkdirs.."/*", targetdir)
|
||||||
|
print("copy",linkdirs, targetdir)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -2,4 +2,8 @@ rule("engine.api")
|
|||||||
on_config(function (target)
|
on_config(function (target)
|
||||||
import("rule_api")
|
import("rule_api")
|
||||||
rule_api(target)
|
rule_api(target)
|
||||||
|
end)
|
||||||
|
on_load(function (target)
|
||||||
|
import("package_api")
|
||||||
|
package_api(target)
|
||||||
end)
|
end)
|
||||||
Loading…
Reference in New Issue
Block a user