diff options
author | Brad King <brad.king@kitware.com> | 2019-02-18 16:43:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-19 12:29:27 (GMT) |
commit | b186329d3db0083d77e61ded709f4e70a596631d (patch) | |
tree | b90765bf6de27c0ed51a846aaba8529e9eadaa59 /Modules/CMakeDetermineCompilerId.cmake | |
parent | e6897c72e7c59f7a0b82ed19c1bdb40d42f7adaa (diff) | |
download | CMake-b186329d3db0083d77e61ded709f4e70a596631d.zip CMake-b186329d3db0083d77e61ded709f4e70a596631d.tar.gz CMake-b186329d3db0083d77e61ded709f4e70a596631d.tar.bz2 |
Use -? instead of /? to test compiler for MSVC-like command-line support
MS-style command-line tools accept either `/` or `-` for command-line
options. Prefer `-` over `/` so that non-MS tools do not treat it as a
path.
Fixes: #18941
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 83ce392..8ba4246 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -824,7 +824,7 @@ function(CMAKE_DIAGNOSE_UNSUPPORTED_CLANG lang envvar) endif() # Test whether an MSVC-like command-line option works. - execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" /? + execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -? RESULT_VARIABLE _clang_result OUTPUT_VARIABLE _clang_stdout ERROR_VARIABLE _clang_stderr) |