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.
This commit is contained in:
Brad King
2021-07-01 12:56:17 -04:00
parent e610e99ad3
commit e93245ec64
2 changed files with 4 additions and 2 deletions

View File

@@ -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)

View File

@@ -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()