Skip to content

Commit 246fba2

Browse files
committed
xrCore: Add GetBuildConfiguration() function
It allows you to get the build configuration Also show the project name in log instead of 'xrCore'
1 parent fca4cdc commit 246fba2

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/xrCore/xrCore.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void xrCore::Initialize(pcstr _ApplicationName, LogCallback cb, bool init_fs, pc
7373
DUMP_PHASE;
7474

7575
InitLog();
76-
Msg("'%s' build %d, %s\n", "xrCore", buildId, buildDate);
76+
Msg("%s %s build %d, %s\n", "xdOpenXRay", GetBuildConfiguration(), buildId, buildDate);
7777
_initialize_cpu();
7878
R_ASSERT(CPU::ID.hasFeature(CpuFeature::Sse));
7979
ttapi_Init(CPU::ID);
@@ -151,6 +151,29 @@ void xrCore::_destroy()
151151
}
152152
}
153153

154+
constexpr pcstr xrCore::GetBuildConfiguration()
155+
{
156+
#ifdef NDEBUG
157+
#ifdef XR_X64
158+
return "Rx64";
159+
#else
160+
return "Rx86";
161+
#endif
162+
#elif defined(MIXED)
163+
#ifdef XR_X64
164+
return "Mx64";
165+
#else
166+
return "Mx86";
167+
#endif
168+
#else
169+
#ifdef XR_X64
170+
return "Dx64";
171+
#else
172+
return "Dx86";
173+
#endif
174+
#endif
175+
}
176+
154177
void xrCore::CalculateBuildId()
155178
{
156179
const int startDay = 31;

src/xrCore/xrCore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ class XRCORE_API xrCore
199199
void _destroy();
200200
const char* GetBuildDate() const { return buildDate; }
201201
u32 GetBuildId() const { return buildId; }
202+
static constexpr pcstr GetBuildConfiguration();
202203

203204
private:
204205
void CalculateBuildId();

0 commit comments

Comments
 (0)