Fix __cplusplus macro on MSVC and add logging C++ version used during compilation

This commit is contained in:
Wojtek Figat
2023-11-28 15:55:34 +01:00
parent cf8b7a20c2
commit 0aeac36f09
2 changed files with 8 additions and 1 deletions

View File

@@ -522,7 +522,13 @@ void EngineImpl::InitLog()
LOG(Info, "Compiled for Dev Environment");
#endif
LOG(Info, "Version " FLAXENGINE_VERSION_TEXT);
LOG(Info, "Compiled: {0} {1}", TEXT(__DATE__), TEXT(__TIME__));
const Char* cpp = TEXT("?");
if (__cplusplus == 202101L) cpp = TEXT("C++23");
else if (__cplusplus == 202002L) cpp = TEXT("C++20");
else if (__cplusplus == 201703L) cpp = TEXT("C++17");
else if (__cplusplus == 201402L) cpp = TEXT("C++14");
else if (__cplusplus == 201103L) cpp = TEXT("C++11");
LOG(Info, "Compiled: {0} {1} {2}", TEXT(__DATE__), TEXT(__TIME__), cpp);
#ifdef _MSC_VER
const String mcsVer = StringUtils::ToString(_MSC_FULL_VER);
LOG(Info, "Compiled with Visual C++ {0}.{1}.{2}.{3:0^2d}", mcsVer.Substring(0, 2), mcsVer.Substring(2, 2), mcsVer.Substring(4, 5), _MSC_BUILD);

View File

@@ -453,6 +453,7 @@ namespace Flax.Build.Platforms
commonArgs.Add("/std:c++latest");
break;
}
commonArgs.Add("/Zc:__cplusplus");
// Generate Intrinsic Functions
if (compileEnvironment.IntrinsicFunctions)