Skip to content

Supports clang on Windows #70

@longnguyen2004

Description

@longnguyen2004

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions