51#define ZIVID_STRINGIZE_1(X) #X
52#define ZIVID_STRINGIZE(X) ZIVID_STRINGIZE_1(X)
57 struct OpenCLContextPtr;
58 struct CUDAContextPtr;
66 ZIVID_CORE_EXPORT Application createApplicationForWrapper(EnvironmentInfo::Wrapper wrapper);
70 EnvironmentInfo::Wrapper wrapper,
71 OpenCLContextPtr openclContext,
72 CUDAContextPtr cudaContext);
74 inline EnvironmentInfo::UserToolchain::Compiler detectCompiler()
76 using CompilerType = EnvironmentInfo::UserToolchain::Compiler::ID;
77 using CompilerVersion = EnvironmentInfo::UserToolchain::Compiler::Version;
80 CompilerVersion version;
83# if defined(__INTEL_LLVM_COMPILER) || defined(__INTEL_COMPILER)
84 type = CompilerType{ CompilerType::ValueType::intel };
85 version = CompilerVersion{ __VERSION__ };
87# elif defined(_MSC_VER) && !defined(__clang__)
88 type = CompilerType{ CompilerType::ValueType::msvc };
90# elif defined(__clang__)
91 type = CompilerType{ CompilerType::ValueType::clang };
92 version = CompilerVersion{ __clang_version__ };
93# elif defined(__GNUC__)
94 type = CompilerType{ CompilerType::ValueType::gcc };
99# if defined(__MINGW32__) || defined(__MINGW64__)
100 constexpr bool isMingw =
true;
102 constexpr bool isMingw =
false;
107 if(type.value() == CompilerType::ValueType::gcc)
109 type = CompilerType{ CompilerType::ValueType::mingwGcc };
111 else if(type.value() == CompilerType::ValueType::clang)
113 type = CompilerType{ CompilerType::ValueType::mingwClang };
117 type = CompilerType{ CompilerType::ValueType::mingwUnknown };
121 return EnvironmentInfo::UserToolchain::Compiler{ type, version };
124 inline EnvironmentInfo::UserToolchain::StandardLibrary detectStandardLibrary()
126 using StdlibType = EnvironmentInfo::UserToolchain::StandardLibrary::ID;
127 using StdlibVersion = EnvironmentInfo::UserToolchain::StandardLibrary::Version;
130 StdlibVersion version;
133 type = StdlibType{ StdlibType::ValueType::msvc };
135# elif defined(_LIBCPP_VERSION)
136 type = StdlibType{ StdlibType::ValueType::libcxx };
138# elif defined(__GLIBCXX__)
139 type = StdlibType{ StdlibType::ValueType::libstdcxx };
143 return EnvironmentInfo::UserToolchain::StandardLibrary{ type, version };
146 inline EnvironmentInfo::UserToolchain::CxxStandard detectCxxStandard()
151 return EnvironmentInfo::UserToolchain::CxxStandard{ std::to_string(_MSVC_LANG) };
153 return EnvironmentInfo::UserToolchain::CxxStandard{ std::to_string(__cplusplus) };
157 inline EnvironmentInfo::UserToolchain detectToolchain()
159 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:85