diff options
author | Brad King <brad.king@kitware.com> | 2021-06-30 11:26:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-30 11:26:25 (GMT) |
commit | eb2ea3db8beffd0779b034b5ee4697cfef3e9088 (patch) | |
tree | a706f7dae453b8be4a449cbf05bfebc57e17e997 | |
parent | 82183329a5ea8c2ef0158bf6f94946741c189723 (diff) | |
parent | c6aaaf066a39485bf34869ccae5b5d4fac04f0b9 (diff) | |
download | CMake-eb2ea3db8beffd0779b034b5ee4697cfef3e9088.zip CMake-eb2ea3db8beffd0779b034b5ee4697cfef3e9088.tar.gz CMake-eb2ea3db8beffd0779b034b5ee4697cfef3e9088.tar.bz2 |
Merge topic 'compiler-id-msvc-has-include'
c6aaaf066a DetermineCompiler: Restore identification of MSVC with no INCLUDE dirs
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !6284
-rw-r--r-- | Modules/CMakeDetermineCCompiler.cmake | 4 | ||||
-rw-r--r-- | Modules/CMakeDetermineCXXCompiler.cmake | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index cd07ba9..ca497f1 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -85,6 +85,10 @@ else() # ARMClang need target options "--target=arm-arm-none-eabi -mcpu=cortex-m3" + + # MSVC needs at least one include directory for __has_include to function, + # but custom toolchains may run MSVC with no INCLUDE env var and no -I flags. + "-I__does_not_exist__" ) endif() if(CMAKE_C_COMPILER_TARGET) diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 3d1a7bb..e297f90 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -80,6 +80,10 @@ else() # ARMClang need target options "--target=arm-arm-none-eabi -mcpu=cortex-m3" + + # MSVC needs at least one include directory for __has_include to function, + # but custom toolchains may run MSVC with no INCLUDE env var and no -I flags. + "-I__does_not_exist__" ) endif() |