tbb icon indicating copy to clipboard operation
tbb copied to clipboard

Supports clang on Windows

Open longnguyen2004 opened this issue 3 years ago • 3 comments

This should better be on the main TBB repo itself, but since I've waited for a month with no response, I'll just gonna move this here xD There are two flavors of clang on Windows: clang-cl (imitating MSVC) and normal clang (imitating GCC). You can check for them by using this code snippet:

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
  if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
    # using clang with clang-cl front end
  elseif (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "GNU")
    # using clang with regular front end
  endif()
endif()

(note: CMake 3.15 and above) For clang-cl, everything is the same as MSVC. But normal clang is a different story. It doesn't support version scripts on Windows, but it does support regular def files. So we can use the MSVC def file, but with GNU names instead. I can help you out if you need to.

longnguyen2004 avatar Aug 05 '20 04:08 longnguyen2004

So its about these lines: https://github.com/wjakob/tbb/blob/master/CMakeLists.txt#L223 right ? Yes this is not obvious, a patch would help.

jschueller avatar Aug 20 '20 12:08 jschueller

Alright I'll try to work on it.

longnguyen2004 avatar Aug 20 '20 12:08 longnguyen2004

Please see #73

longnguyen2004 avatar Aug 22 '20 16:08 longnguyen2004