https://github.com/thecompez/platform-detector
A useful tool for identifying the architecture, platform type, compiler, and operating system specifications by preprocessor feature support.
https://github.com/thecompez/platform-detector
android architecture compilers cplusplus cross-platform detector freebsd ios linux macos openbsd platform-detector system-information windows
Last synced: 4 months ago
JSON representation
A useful tool for identifying the architecture, platform type, compiler, and operating system specifications by preprocessor feature support.
- Host: GitHub
- URL: https://github.com/thecompez/platform-detector
- Owner: TheCompez
- License: mit
- Created: 2021-04-24T05:41:35.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-22T11:31:29.000Z (about 3 years ago)
- Last Synced: 2024-11-19T20:53:04.011Z (5 months ago)
- Topics: android, architecture, compilers, cplusplus, cross-platform, detector, freebsd, ios, linux, macos, openbsd, platform-detector, system-information, windows
- Language: C++
- Homepage:
- Size: 64.5 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Platform-Detector
## Cross-Platform Information Detector ##
It is a useful tool for identifying the architecture, platform type, compiler, and operating system specifications.[](https://forthebadge.com)
## Building
- You need CMake tool for building source code
```
cd build
cmake ..
make
```## Usage Example
```cpp
#include#include "include/detector.hpp"
using namespace std;
using namespace SystemInformation;int main()
{
cout << "Hello World!" << endl;
cout << "Platform Architecture : " << Detector::getArchitecture () << endl;
cout << "Processor Vendor : " << Detector::getProcessorVendor () << endl;
cout << "Platform Type : " << Detector::getPlatformType () << endl;
cout << "Operation System : " << Detector::getOperationSystem () << endl;
cout << "Compiler Name : " << Detector::getCompilerName () << endl;
cout << "Compiler Version : " << Detector::getCompilerVersion () << endl;//!Compiler Stataement
#if defined(__COMPILER_CLANG_LLVM_)
cout << "Clang compiler has been detected!\n";
#elif defined(__COMPILER_INTEL__)
cout << "Intel compiler has been detected!\n";
#elif defined(__COMPILER_INTEL__)
cout << "Intel compiler has been detected!\n";
#elif defined(__COMPILER_MINGW__)
cout << "MinGW compiler has been detected!\n";
#elif defined(__COMPILER_MINGW_64__)
cout << "MinGW64 compiler has been detected!\n";
#elif defined(__COMPILER_GCC__)
cout << "GCC compiler has been detected!\n";
#elif defined(__COMPILER__HEWLETT_)
cout << "Hewlett compiler has been detected!\n";
#elif defined(__COMPILER_IBM__)
cout << "IBM compiler has been detected!\n";
#elif defined(__COMPILER_MSVC__)
cout << "MSVC compiler has been detected!\n";
#elif defined(__COMPILER_PGCC__)
cout << "PGCC compiler has been detected!\n";
#elif defined(__COMPILER_ORACLE__)
cout << "Oracle compiler has been detected!\n";
#endif//!Platform Stataement
#if defined(PLATFORM_MAC)
cout << "This is macOS platform!\n";
#elif defined(PLATFORM_WINDOWS)
cout << "This is macOS platform!\n";
#elif defined(PLATFORM_LINUX)
cout << "This is Linux platform!\n";
#elif defined(PLATFORM_WINDOWS)
cout << "This is Windows platform!\n";
#elif defined(PLATFORM_FREEBSD)
cout << "This is freeBSD platform!\n";
#elif defined(PLATFORM_OPENBSD)
cout << "This is openBSD platform!\n";
#elif defined(PLATFORM_VXWORKS)
cout << "This is VXWorks platform!\n";
#elif defined(PLATFORM_MOTOROLA)
cout << "This is Motorola platform!\n";
#elif defined(PLATFORM_ULTRIX)
cout << "This is Ultrix platform!\n";
#elif defined(PLATFORM_DOS)
cout << "This is Dos platform!\n";
#elif defined(PLATFORM_WINDOWS_PHONE)
cout << "This is Windows Phone platform!\n";
#elif defined(PLATFORM_IOS_SIMULATOR)
cout << "This is iOS Simulator platform!\n";
#elif defined(PLATFORM_IOS)
cout << "This is iOS platform!\n";
#elif defined(PLATFORM_APPLE_TV)
cout << "This is AppleTV platform!\n";
#elif defined(PLATFORM_IWATCH)
cout << "This is iWatch platform!\n";
#elif defined(PLATFORM_ANDROID)
cout << "This is Android platform!\n";
#endif
cout << "Detected C++ Standard ISO Value : " << __CPP_VALUE__ << "\n";
cout << "Detected C++ Standard Version : " << __CPP_VERSION__ << "\n";return 0;
}```
## Contribution
Bug fixes, docs, and enhancements welcome! Please let me know [email protected]