Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Misc Update #369

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions CMake/Target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,11 @@ function(AddMirrorInfoSourceGenerationTarget)
foreach (SEARCH_DIR ${PARAMS_SEARCH_DIR})
file(GLOB_RECURSE INPUT_HEADER_FILES "${SEARCH_DIR}/*.h")
foreach (INPUT_HEADER_FILE ${INPUT_HEADER_FILES})
get_filename_component(FILENAME ${INPUT_HEADER_FILE} NAME_WE)
string(REPLACE "${CMAKE_SOURCE_DIR}/" "" TEMP ${INPUT_HEADER_FILE})
get_filename_component(DIR ${TEMP} DIRECTORY)
get_filename_component(FILENAME ${TEMP} NAME_WE)

set(OUTPUT_SOURCE "${CMAKE_BINARY_DIR}/Generated/MirrorInfoSource/${PARAMS_NAME}/${FILENAME}.generated.cpp")
set(OUTPUT_SOURCE "${CMAKE_BINARY_DIR}/Generated/MirrorInfoSource/${DIR}/${FILENAME}.generated.cpp")
list(APPEND OUTPUT_SOURCES ${OUTPUT_SOURCE})

add_custom_command(
Expand Down Expand Up @@ -289,10 +291,10 @@ function(AddExecutable)
)
endif()

add_executable(
add_executable(${PARAMS_NAME})
target_sources(
${PARAMS_NAME}
${PARAMS_SRC}
${GENERATED_SRC}
PRIVATE ${PARAMS_SRC} ${GENERATED_SRC}
)
target_include_directories(
${PARAMS_NAME}
Expand Down Expand Up @@ -351,8 +353,10 @@ function(AddLibrary)
add_library(
${PARAMS_NAME}
${PARAMS_TYPE}
${PARAMS_SRC}
${GENERATED_SRC}
)
target_sources(
${PARAMS_NAME}
PRIVATE ${PARAMS_SRC} ${GENERATED_SRC}
)
target_include_directories(
${PARAMS_NAME}
Expand Down Expand Up @@ -414,10 +418,10 @@ function(AddTest)
)
endif()

add_executable(
add_executable(${PARAMS_NAME})
target_sources(
${PARAMS_NAME}
${PARAMS_SRC}
${GENERATED_SRC}
PRIVATE ${PARAMS_SRC} ${GENERATED_SRC}
)
target_include_directories(
${PARAMS_NAME}
Expand Down
2 changes: 1 addition & 1 deletion CMake/ThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function(Get3rdPlatformValue)
cmake_parse_arguments(PARAMS "ARCH" "OUTPUT" "INPUT" ${ARGN})

if (${PARAMS_ARCH})
set(PLATFORM_KEYWORDS "Windows-AMD64;Darwin-arm64;Darwin-x86_64")
set(PLATFORM_KEYWORDS "Windows-AMD64;Darwin-arm64")
set(CURRENT_KEYWORDS "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
else()
set(PLATFORM_KEYWORDS "Windows;Darwin;Linux")
Expand Down
2 changes: 1 addition & 1 deletion Editor/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AddExecutable(
NAME Editor
SRC ${SOURCES}
INC Include
LIB Qt Core RHI Rendering Runtime
LIB Qt Core RHI Runtime
RES ${FINAL_RESOURCES}
)

Expand Down
5 changes: 1 addition & 4 deletions Editor/Source/Include/Editor/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once

#include <Runtime/Engine.h>
#include <Rendering/RenderingModule.h>
#include <Render/RenderModule.h>

namespace Editor {
class Core {
Expand All @@ -17,17 +17,14 @@ namespace Editor {
void Initialize(int argc, char** argv);
void Cleanup();
bool ProjectHasSet() const;
Rendering::RenderingModule* GetRenderingModule() const;
Runtime::Engine* GetEngine() const;

private:
Core();

void ParseCommandLineArgs(int argc, char** argv) const;
void InitializeRuntime();
void InitializeRendering();

Rendering::RenderingModule* renderingModule;
Runtime::Engine* engine;
};
}
22 changes: 3 additions & 19 deletions Editor/Source/Src/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ namespace Editor {
}

Core::Core()
: renderingModule(nullptr)
, engine(nullptr)
: engine(nullptr)
{
}

Expand All @@ -32,13 +31,11 @@ namespace Editor {
{
ParseCommandLineArgs(argc, argv);
InitializeRuntime();
InitializeRendering();
}

void Core::Cleanup() // NOLINT
{
::Core::ModuleManager::Get().Unload("Runtime");
::Core::ModuleManager::Get().Unload("Rendering");
}

Runtime::Engine* Core::GetEngine() const
Expand All @@ -51,11 +48,6 @@ namespace Editor {
return !caProjectFile.GetValue().empty();
}

Rendering::RenderingModule* Core::GetRenderingModule() const
{
return renderingModule;
}

void Core::ParseCommandLineArgs(int argc, char** argv) const // NOLINT
{
::Core::Cli::Get().Parse(argc, argv);
Expand All @@ -65,17 +57,9 @@ namespace Editor {
{
Runtime::EngineInitParams params {};
params.projectFile = caProjectFile.GetValue();
params.rhiType = caRhiType.GetValue();

Runtime::EngineHolder::Load("Editor", params);
engine = &Runtime::EngineHolder::Get();
}

void Core::InitializeRendering()
{
renderingModule = ::Core::ModuleManager::Get().FindOrLoadTyped<Rendering::RenderingModule>("Rendering");
Assert(renderingModule != nullptr);

Rendering::RenderingModuleInitParams initParams;
initParams.rhiType = RHI::RHIAbbrStringToRHIType(caRhiType.GetValue());
renderingModule->Initialize(initParams);
}
}
1 change: 0 additions & 1 deletion Engine/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ add_subdirectory(Mirror)
add_subdirectory(Core)
add_subdirectory(Render)
add_subdirectory(Runtime)
add_subdirectory(Rendering)

add_subdirectory(RHI-Dummy)
add_subdirectory(RHI-Vulkan)
Expand Down
2 changes: 1 addition & 1 deletion Engine/Source/Common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AddLibrary(
TYPE STATIC
SRC ${SOURCES}
PUBLIC_INC Include
LIB debugbreak cityhash taskflow fmt-lib rapidjson
LIB debugbreak cityhash taskflow rapidjson
)

file(GLOB TEST_SOURCES Test/*.cpp)
Expand Down
Loading
Loading