bombomby / optick

C++ Profiler For Games
https://optick.dev
MIT License
2.95k stars 296 forks source link

Support for ClangCL #180

Open HITOA opened 2 years ago

HITOA commented 2 years ago

It can compile with clang-cl but do not because of some macro in optick.h :

if defined(__clang__) || defined(__GNUC__)
#   define OPTICK_GCC (1)
#   if defined(__APPLE_CC__)
#       define OPTICK_OSX (1)
#   elif defined(__linux__)
#       define OPTICK_LINUX (1)
#   elif defined(__FreeBSD__)
#       define OPTICK_FREEBSD (1)
#   endif
#elif defined(_MSC_VER)
#   define OPTICK_MSVC (1)
#   if defined(_DURANGO)
#       define OPTICK_PC (0)
#   else
#       define OPTICK_PC (1)
#endif
#else
#error Compiler not supported
#endif

When clang-cl is used, both __clang__ and _MSC_VER are defined, it's a really small fix, but i think it's worth doing it :D!