zufuliu / llvm-utils

LLVM/Clang toolsets for Visual Studio 2022, 2019, 2017, 2015, 2013, 2012 and 2010.
Other
209 stars 35 forks source link

Added __clang__ and __llvm__ defines: Fix #9 #10

Closed GloriousPtr closed 1 year ago

zufuliu commented 1 year ago

Both are defined, you can run echo | clang-cl -Xclang -dM -E - and echo | clang-cl -Xclang -dM -E -Xclang -xc++ - to see predefined macros for C and C++.

unlike clang-cl, lld-link, llvm-lib and llvm-rc are less comparability with their counterparts, you can update your project to enabled them.

zufuliu commented 1 year ago

llvm-rc doesn't support #pragma code_page (e.g. all rc file in https://github.com/zufuliu/notepad2 failed to compile unless adding /c 65001 command line option, default code page for llvm-rc.exe is 1252, https://github.com/llvm/llvm-project/blob/main/llvm/tools/llvm-rc/llvm-rc.cpp#L486).

Following lines need update to enable lld-link and llvm-lib: https://github.com/zufuliu/llvm-utils/blob/1d67aba338011e77de5d185eed646d90c98b640e/VS2017/LLVM/LLVM.Common.props#L10-L14

We need to ignore unsupported options (CheckOption.py result) before enable them.

GloriousPtr commented 1 year ago

My bad, 98248c9a906524562942678eca4cddc51d901d9a wasn't supposed to be here in the pull request.

zufuliu commented 1 year ago

lld-link and llvm-lib can be enabled (to match old official extension or LLVM (clang-cl)) after 66f35f403c30b8608496e3b83b669ac926d0d777.