Include/AuroraEnvironment.hpp
2021-05-21 17:34:33 +01:00

166 lines
5.5 KiB
C++

/***
Copyright (©) 2020 Reece Wilson (a/k/a "Reece").
All rights reserved.
File: AuroraEnvironment.hpp
Date: 2020-6-9
Originator: Reece
Purpose:
***/
#pragma once
extern "C"
{
#include "AuroraEnvironment.h"
}
namespace Aurora::Build
{
enum class ECompiler
{
kInvaild = -1,
kMSVC,
kClang,
kGCC
};
#if defined(AURORA_COMPILER_CLANG)
static const ECompiler kCurrentECompiler = ECompiler::kClang;
#elif defined(AURORA_COMPILER_MSVC)
static const ECompiler kCurrentECompiler = ECompiler::kMSVC;
#elif defined(AURORA_COMPILER_GCC)
static const ECompiler kCurrentECompiler = ECompiler::kGCC;
#else
static const ECompiler kCurrentECompiler = ECompiler::kInvaild;
#endif
enum class EPlatform
{
kInvalid = -1,
kKernelLinux,
kKernelNtos,
kPlatformWin32,
kPlatformAndroid,
kPlatformLinux,
kPlatformApple,
kPlatformIos,
kPlatformSwitch,
kPlatformPS4,
kPlatformPS5,
kPlatformXbone,
kPlatformWii,
kPlatformWiiU
};
#if defined(AURORA_PLATFORM_KERNEL_LINUX)
static const EPlatform kCurrentPlatform = EPlatform::kKernelLinux;
#elif defined(AURORA_PLATFORM_NTOS)
static const EPlatform kCurrentPlatform = EPlatform::kKernelNtos;
#elif defined(AURORA_PLATFORM_WIN32)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformWin32;
#elif defined(AURORA_PLATFORM_ANDROID)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformAndroid;
#elif defined(AURORA_PLATFORM_LINUX)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformLinux;
#elif defined(AURORA_PLATFORM_APPLE)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformApple;
#elif defined(AURORA_PLATFORM_IOS)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformIos;
#elif defined(AURORA_PLATFORM_SWITCH)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformSwitch;
#elif defined(AURORA_PLATFORM_PS4)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformPS4;
#elif defined(AURORA_PLATFORM_PS5)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformPS5;
#elif defined(AURORA_PLATFORM_XBONE)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformXbone;
#elif defined(AURORA_PLATFORM_WII)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformWii;
#elif defined(AURORA_PLATFORM_WII_U)
static const EPlatform kCurrentPlatform = EPlatform::kPlatformWiiU;
#else
static const EPlatform kCurrentPlatform = EPlatform::kInvalid;
#endif
enum class EVendor
{
kInvalid = -1,
kUnknown = 0,
kConsoleMicrosft,
kConsoleSony,
kConsoleNintendo,
kGenericApple,
kGenericMicrosoft,
};
#if defined(VENDOR_CONSOLE_MICROSOFT)
static const EVendor kCurrentVendor = EVendor::kConsoleMicrosft;
#elif defined(VENDOR_GENERIC_APPLE)
static const EVendor kCurrentVendor = EVendor::kGenericApple;
#elif defined(VENDOR_CONSOLE_SONY)
static const EVendor kCurrentVendor = EVendor::kConsoleSony;
#elif defined(VENDOR_CONSOLE_NINTENDO)
static const EVendor kCurrentVendor = EVendor::kConsoleNintendo;
#elif defined(VENDOR_GENERIC_MICROSOFT)
static const EVendor kCurrentVendor = EVendor::kGenericMicrosoft;
#elif defined(VENDOR_UNKNOWN)
static const EVendor kCurrentVendor = EVendor::kUnknown;
#else
static const EVendor kCurrentVendor = EVendor::kInvalid;
#endif
enum class EArchitecture
{
kInvalid = -1,
kX86_32,
kX86_64,
kAArch64
};
#if defined(AURORA_ARCH_X86)
static const EArchitecture kCurrentArchitecture = EArchitecture::kX86_32;
#elif defined(AURORA_ARCH_X64)
static const EArchitecture kCurrentArchitecture = EArchitecture::kX86_64;
#elif defined(AURORA_ARCH_ARM)
static const EArchitecture kCurrentArchitecture = EArchitecture::kAArch64;
#else
static const EArchitecture kCurrentArchitecture = EArchitecture::kInvalid;
#endif
enum class EABI
{
kInvalid = -1,
// MSFTs in house amd64 abi
kMSFT64,
// MSFTs in house aarch64 abi
kMSFTArm,
// x86 sysv and microsoft only deviate with fastcall and thiscall :(
kCdeclIntel,
// x86_64 others
kSysV,
// tim apple is special
kAppleArm,
// other arm EPlatforms...
kLLVMArm
};
#if defined(AURORA_ABI_MSFT_64)
static const EABI kCurrentABI = EABI::kMSFT64;
#elif defined(AURORA_ABI_MS_ARM)
static const EABI kCurrentABI = EABI::kMSFTArm;
#elif defined(AURORA_ABI_LLVM_ARM)
static const EABI kCurrentABI = EABI::kLLVMArm;
#elif defined(AURORA_ABI_CDECL)
static const EABI kCurrentABI = EABI::kCdeclIntel;
#elif defined(AURORA_ABI_SYSV)
static const EABI kCurrentABI = EABI::kSysV;
#elif defined(AURORA_ABI_APPLE)
static const EABI kCurrentABI = EABI::kAppleArm;
#else
static const EABI kCurrentABI = EABI::kInvalid;
#endif
}