Skip to content

Commit 343e6bb

Browse files
committed
[meta] Move metadata file into a subfolder
1 parent ba15e98 commit 343e6bb

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

benchmarks/engine_benchmark_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <benchmark/benchmark.h>
22

3-
#include "inexor/vulkan-renderer/meta.hpp"
3+
#include "inexor/vulkan-renderer/meta/meta.hpp"
44

55
#include <iostream>
66

77
int main(int argc, char **argv) {
8-
using namespace inexor::vulkan_renderer;
8+
using namespace inexor::vulkan_renderer::meta;
99

1010
// Print engine and application metadata.
1111
std::cout << ENGINE_NAME << ", version " << ENGINE_VERSION_STR << std::endl;

include/inexor/vulkan-renderer/meta.hpp.in renamed to include/inexor/vulkan-renderer/meta/meta.hpp.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <array>
44

5-
namespace inexor::vulkan_renderer {
5+
namespace inexor::vulkan_renderer::meta {
66

77
/// The following data will be replaced by CMake setup.
88
constexpr const char *APP_NAME{"${INEXOR_APP_NAME}"};

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ endif()
101101

102102
# Replace variables in header file with CMake values
103103
configure_file(
104-
${PROJECT_SOURCE_DIR}/include/inexor/vulkan-renderer/meta.hpp.in
105-
${CMAKE_CURRENT_BINARY_DIR}/include/inexor/vulkan-renderer/meta.hpp
104+
${PROJECT_SOURCE_DIR}/include/inexor/vulkan-renderer/meta/meta.hpp.in
105+
${CMAKE_CURRENT_BINARY_DIR}/include/inexor/vulkan-renderer/meta/meta.hpp
106106
)
107107

108108
target_include_directories(

src/vulkan-renderer/application.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "inexor/vulkan-renderer/application.hpp"
22

33
#include "inexor/vulkan-renderer/exception.hpp"
4-
#include "inexor/vulkan-renderer/meta.hpp"
4+
#include "inexor/vulkan-renderer/meta/meta.hpp"
55
#include "inexor/vulkan-renderer/octree_gpu_vertex.hpp"
66
#include "inexor/vulkan-renderer/standard_ubo.hpp"
77
#include "inexor/vulkan-renderer/tools/camera.hpp"
@@ -286,7 +286,7 @@ void Application::initialize_spdlog() {
286286
auto console_sink = std::make_shared<spdlog::sinks::stdout_color_sink_mt>();
287287

288288
// A copy of the console output will automatically be saved to a logfile
289-
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(std::string(APP_NAME) + ".log", true);
289+
auto file_sink = std::make_shared<spdlog::sinks::basic_file_sink_mt>(std::string(meta::APP_NAME) + ".log", true);
290290
auto logger = std::make_shared<spdlog::async_logger>("main", spdlog::sinks_init_list{console_sink, file_sink},
291291
spdlog::thread_pool(), spdlog::async_overflow_policy::block);
292292

@@ -303,6 +303,8 @@ void Application::initialize_spdlog() {
303303
Application::Application(int argc, char **argv) {
304304
initialize_spdlog();
305305

306+
using namespace vulkan_renderer::meta;
307+
306308
spdlog::trace("Application version: {}.{}.{}", APP_VERSION[0], APP_VERSION[1], APP_VERSION[2]);
307309
spdlog::trace("Engine version: {}.{}.{}", ENGINE_VERSION[0], ENGINE_VERSION[1], ENGINE_VERSION[2]);
308310

@@ -492,7 +494,8 @@ void Application::update_imgui_overlay() {
492494
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0);
493495
ImGui::SetNextWindowPos(ImVec2(10, 10));
494496
ImGui::SetNextWindowSize(ImVec2(330, 0));
495-
ImGui::Begin("Inexor Vulkan-renderer", nullptr,
497+
using namespace vulkan_renderer::meta;
498+
ImGui::Begin(APP_NAME, nullptr,
496499
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
497500
ImGui::Text("%s", m_device->gpu_name().c_str());
498501
ImGui::Text("Engine version %d.%d.%d (Git sha %s)", ENGINE_VERSION[0], ENGINE_VERSION[1], ENGINE_VERSION[2],

tests/unit_tests_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include <gtest/gtest.h>
22

3-
#include "inexor/vulkan-renderer/meta.hpp"
3+
#include "inexor/vulkan-renderer/meta/meta.hpp"
44

55
#include <iostream>
66

77
int main(int argc, char **argv) {
8-
using namespace inexor::vulkan_renderer;
8+
using namespace inexor::vulkan_renderer::meta;
99

1010
// Print engine and application metadata.
1111
std::cout << ENGINE_NAME << ", version " << ENGINE_VERSION_STR << std::endl;

0 commit comments

Comments
 (0)