Skip to content

Commit

Permalink
xrCore: Add GetBuildConfiguration() function
Browse files Browse the repository at this point in the history
It allows you to get the build configuration

Also show the project name in log instead of 'xrCore'
  • Loading branch information
Xottab-DUTY committed Dec 22, 2017
1 parent fca4cdc commit 246fba2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/xrCore/xrCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void xrCore::Initialize(pcstr _ApplicationName, LogCallback cb, bool init_fs, pc
DUMP_PHASE;

InitLog();
Msg("'%s' build %d, %s\n", "xrCore", buildId, buildDate);
Msg("%s %s build %d, %s\n", "xdOpenXRay", GetBuildConfiguration(), buildId, buildDate);
_initialize_cpu();
R_ASSERT(CPU::ID.hasFeature(CpuFeature::Sse));
ttapi_Init(CPU::ID);
Expand Down Expand Up @@ -151,6 +151,29 @@ void xrCore::_destroy()
}
}

constexpr pcstr xrCore::GetBuildConfiguration()
{
#ifdef NDEBUG
#ifdef XR_X64
return "Rx64";
#else
return "Rx86";
#endif
#elif defined(MIXED)
#ifdef XR_X64
return "Mx64";
#else
return "Mx86";
#endif
#else
#ifdef XR_X64
return "Dx64";
#else
return "Dx86";
#endif
#endif
}

void xrCore::CalculateBuildId()
{
const int startDay = 31;
Expand Down
1 change: 1 addition & 0 deletions src/xrCore/xrCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class XRCORE_API xrCore
void _destroy();
const char* GetBuildDate() const { return buildDate; }
u32 GetBuildId() const { return buildId; }
static constexpr pcstr GetBuildConfiguration();

private:
void CalculateBuildId();
Expand Down

0 comments on commit 246fba2

Please sign in to comment.