summaryrefslogtreecommitdiff
path: root/clang/test/Driver/cl-sysroot.cpp
AgeCommit message (Collapse)Author
2022-01-18[clang] Add include path for cppwinrt on Windows SDK 10.0.17134+Kagami Sascha Rosylight
This fixes https://github.com/llvm/llvm-project/issues/53112 by adding cppwinrt to the include path when the SDK version is higher than 10.0.17134.0. Differential revision: https://reviews.llvm.org/D117407
2021-09-16[clang-cl] Fix test after 951f362e256 on systems where default target isn't ↵Nico Weber
x86_64
2021-09-16[clang-cl] Add a /diasdkdir flag and make /winsysroot imply itNico Weber
D109708 added "DIA SDK" to our win sysroot for hermetic builds that use LLVM_ENABLE_DIA_SDK. But the build system still has to manually pass flags pointing to it. Since we have a /winsysroot flag, make it look at DIA SDK in the sysroot. With this, the following is enough to compile the DIA2Dump example: out\gn\bin\clang-cl ^ "sysroot\DIA SDK\Samples\DIA2Dump\DIA2Dump.cpp" ^ "sysroot\DIA SDK\Samples\DIA2Dump\PrintSymbol.cpp" ^ "sysroot\DIA SDK\Samples\DIA2Dump\regs.cpp" ^ /diasdkdir "sysroot\DIA SDK" ^ ole32.lib oleaut32.lib diaguids.lib Differential Revision: https://reviews.llvm.org/D109828
2021-01-29clang-cl: Invent a /winsysroot conceptNico Weber
On non-Windows platforms, --sysroot can be used to make the compiler use a single, hermetic directory for all header and library files. This is useful, but difficult to do on Windows. After D95472 it's possible to achieve this with two flags: out/gn/bin/clang-cl win.c -fuse-ld=lld \ /vctoolsdir path/to/VC/Tools/MSVC/14.26.28801 \ /winsdkdir path/to/win_sdk But that's still cumbersome: It requires two flags instead of one, and it requires writing down the (changing) VC/Tools/MSVC version. This adds a new `/winsysroot <dir>` flag that's effectively an alias to these two flags. With this, building against a hermetic Windows toolchain only needs: out/gn/bin/clang-cl win.c -fuse-ld=lld /winsysroot path `/winsysroot <dir>` is the same as adding /vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsver> /winsdkdir <dir>/Windows Kits/<winsdkmajorversion> `<vctoolsver>` is taken from `/vctoolsversion` if passed, or else it's the name of the directory in `<dir>/VC/Tools/MSVC` that's the highest numeric tuple. `<winsdkmajorversion>` is the major version in /winsdkversion if passed, else it's the name of the directory in `<dir>/Windows Kits` that's the highest number. So `/winsysroot <path>` requires this subfolder structure: path/ VC/ Tools/ MSVC/ 14.26.28801 (or another number) include/ ... Windows Kits/ 10/ Include/ 10.0.19041.0/ (or another number) um/ ... Lib/ 10.0.19041.0/ (or another number) um/ x64/ ... ... Differential Revision: https://reviews.llvm.org/D95534