syoyo / tinyexr

Tiny OpenEXR image loader/saver library
710 stars 139 forks source link

Clang compiler settings break clang-cl compilation on windows #207

Closed fknfilewalker closed 3 months ago

fknfilewalker commented 3 months ago

Environment

syoyo commented 3 months ago

You should describe details

fknfilewalker commented 3 months ago

Oh yes sorry

In the cmake the following line gets executed when the compiler used is clang. https://github.com/syoyo/tinyexr/blob/2a5ea89728ed3baac746a75b806a97f402e197c2/CMakeLists.txt#L46

The problem here is that there are some warnings that get turned into errors now on the windows side making the code not compile with clang-cl.

So either we fix the code in tinyexr.cc so that these warnings/errors for windows get resolved or we deactivate these compiler flags for clang-cl on windows.

syoyo commented 3 months ago

Ah, o=it is needed to wrap it with MSVC to detect clang-cl.

if (MSVC) 
  if (CMAKE_CXX_COMPILER_ID SQTEQUAL "Clang")
    // clang-cl
  else() 
    // cl.exe
  endif()
endif ()

You can contribute! PR is much appreciated.