summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeDetermineCCompiler.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-07-01 16:56:17 (GMT)
committerBrad King <brad.king@kitware.com>2021-07-01 17:04:16 (GMT)
commite93245ec64bec6e5f63388e4b4714c7a9d3cbf51 (patch)
treefa1a375211ded052fcd45dd4178c717d8e7ec09a /Modules/CMakeDetermineCCompiler.cmake
parente610e99ad34a545ac67f1977e78ea59a52fdcf79 (diff)
downloadCMake-e93245ec64bec6e5f63388e4b4714c7a9d3cbf51.zip
CMake-e93245ec64bec6e5f63388e4b4714c7a9d3cbf51.tar.gz
CMake-e93245ec64bec6e5f63388e4b4714c7a9d3cbf51.tar.bz2
DetermineCompiler: Restore identification of MSVC with no INCLUDE or LIB
Update the change from commit c6aaaf066a (DetermineCompiler: Restore identification of MSVC with no INCLUDE dirs, 2021-06-29, v3.21.0-rc2~6^2) to also work with no `LIB` dirs. Add the `-c` flag to compile an object file without linking.
Diffstat (limited to 'Modules/CMakeDetermineCCompiler.cmake')
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index ca497f1..0f80f9c 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -88,7 +88,8 @@ else()
# 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__"
+ # Also avoid linking so this works with no LIB env var.
+ "-c -I__does_not_exist__"
)
endif()
if(CMAKE_C_COMPILER_TARGET)