Fix __cplusplus macro on MSVC and add logging C++ version used during compilation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -453,6 +453,7 @@ namespace Flax.Build.Platforms
|
||||
commonArgs.Add("/std:c++latest");
|
||||
break;
|
||||
}
|
||||
commonArgs.Add("/Zc:__cplusplus");
|
||||
|
||||
// Generate Intrinsic Functions
|
||||
if (compileEnvironment.IntrinsicFunctions)
|
||||
|
||||
Reference in New Issue
Block a user