51#define ZIVID_STRINGIZE_1(X) #X
52#define ZIVID_STRINGIZE(X) ZIVID_STRINGIZE_1(X)
64 ZIVID_CORE_EXPORT Application createApplicationForWrapper(EnvironmentInfo::Wrapper wrapper);
66 inline EnvironmentInfo::UserToolchain::Compiler detectCompiler()
68 using CompilerType = EnvironmentInfo::UserToolchain::Compiler::ID;
69 using CompilerVersion = EnvironmentInfo::UserToolchain::Compiler::Version;
72 CompilerVersion version;
75# if defined(__INTEL_LLVM_COMPILER) || defined(__INTEL_COMPILER)
76 type = CompilerType{ CompilerType::ValueType::intel };
77 version = CompilerVersion{ __VERSION__ };
79# elif defined(_MSC_VER) && !defined(__clang__)
80 type = CompilerType{ CompilerType::ValueType::msvc };
82# elif defined(__clang__)
83 type = CompilerType{ CompilerType::ValueType::clang };
84 version = CompilerVersion{ __clang_version__ };
85# elif defined(__GNUC__)
86 type = CompilerType{ CompilerType::ValueType::gcc };
91# if defined(__MINGW32__) || defined(__MINGW64__)
92 constexpr bool isMingw =
true;
94 constexpr bool isMingw =
false;
99 if(type.value() == CompilerType::ValueType::gcc)
101 type = CompilerType{ CompilerType::ValueType::mingwGcc };
103 else if(type.value() == CompilerType::ValueType::clang)
105 type = CompilerType{ CompilerType::ValueType::mingwClang };
109 type = CompilerType{ CompilerType::ValueType::mingwUnknown };
113 return EnvironmentInfo::UserToolchain::Compiler{ type, version };
116 inline EnvironmentInfo::UserToolchain::StandardLibrary detectStandardLibrary()
118 using StdlibType = EnvironmentInfo::UserToolchain::StandardLibrary::ID;
119 using StdlibVersion = EnvironmentInfo::UserToolchain::StandardLibrary::Version;
122 StdlibVersion version;
124# if defined(_MSC_VER)
125 type = StdlibType{ StdlibType::ValueType::msvc };
127# elif defined(_LIBCPP_VERSION)
128 type = StdlibType{ StdlibType::ValueType::libcxx };
130# elif defined(__GLIBCXX__)
131 type = StdlibType{ StdlibType::ValueType::libstdcxx };
135 return EnvironmentInfo::UserToolchain::StandardLibrary{ type, version };
138 inline EnvironmentInfo::UserToolchain::CxxStandard detectCxxStandard()
142# if defined(_MSC_VER)
143 return EnvironmentInfo::UserToolchain::CxxStandard{ std::to_string(_MSVC_LANG) };
145 return EnvironmentInfo::UserToolchain::CxxStandard{ std::to_string(__cplusplus) };
149 inline EnvironmentInfo::UserToolchain detectToolchain()
151 return EnvironmentInfo::UserToolchain{ detectCompiler(), detectStandardLibrary(), detectCxxStandard() };
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56