mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-16 07:28:23 -05:00
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:
@@ -88,7 +88,8 @@ else()
|
|||||||
|
|
||||||
# MSVC needs at least one include directory for __has_include to function,
|
# 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.
|
# 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()
|
endif()
|
||||||
if(CMAKE_C_COMPILER_TARGET)
|
if(CMAKE_C_COMPILER_TARGET)
|
||||||
|
|||||||
@@ -83,7 +83,8 @@ else()
|
|||||||
|
|
||||||
# MSVC needs at least one include directory for __has_include to function,
|
# 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.
|
# 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()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user