Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports clang on Windows #70

Open
longnguyen2004 opened this issue Aug 5, 2020 · 3 comments
Open

Supports clang on Windows #70

longnguyen2004 opened this issue Aug 5, 2020 · 3 comments

Comments

@longnguyen2004
Copy link

longnguyen2004 commented Aug 5, 2020

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.

@jschueller
Copy link
Contributor

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.

@longnguyen2004
Copy link
Author

Alright I'll try to work on it.

@longnguyen2004
Copy link
Author

Please see #73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants