Skip to content

Commit

Permalink
Config path
Browse files Browse the repository at this point in the history
  • Loading branch information
kissholic committed Aug 23, 2024
1 parent 91a1f68 commit 06357ad
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 1 deletion.
4 changes: 4 additions & 0 deletions BEConfig.h.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


#define SHADER_PATH "${SHADER_PATH}"

24 changes: 24 additions & 0 deletions Include/Path.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* File: Path.h
* Author: kissholic
* Copyright (c) 2024 kissholic. All wrongs reserved.
*/

#pragma once

#include <filesystem>


namespace be {

class Path {
public:
static std::filesystem::path ProjectPath() noexcept;
static std::filesystem::path EnginePath() noexcept;

static std::filesystem::path ShaderPath() noexcept;
};


} // namespace be

19 changes: 19 additions & 0 deletions Source/Path.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* File: Path.cpp
* Author: kissholic
* Copyright (c) 2024 kissholic. All wrongs reserved.
*/

#include "Path.h"
#include "BEConfig.h"


namespace be {


std::filesystem::path Path::ShaderPath() noexcept {
return SHADER_PATH;
}


} // namespace be
3 changes: 2 additions & 1 deletion Source/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ target("Main")
set_kind("binary")
add_files("*.cpp")
add_deps("Graphics")
add_packages("spdlog")
add_packages("spdlog", "glad", "glfw")
add_cxxflags("-g")


6 changes: 6 additions & 0 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@ set_warnings("all", "extra", "pedantic")
add_rules("mode.debug", "mode.release")


set_configvar("SHADER_PATH", "$(projectdir)/Shader")

set_configdir("$(buildir)/Config")
add_configfiles("BEConfig.h.in")
add_includedirs("$(buildir)/Config")

add_includedirs("Include")
includes("Source")

0 comments on commit 06357ad

Please sign in to comment.