summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake3
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake3
2 files changed, 4 insertions, 2 deletions
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index ca497f1f90..0f80f9cffc 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)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index e297f90b75..556518f496 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -83,7 +83,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()