mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 05:46:06 +00:00
[CMake][compiler-rt] Support clang-cl in CompilerRTMockLLVMCMakeConfig
clang-cl doesn't support -dumpmachine directly, so we need to preface it with /clang: in order to get this probing function to work. This is needed in order to run cmake directly on the runtimes directory. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D143557
This commit is contained in:
parent
b3477f579c
commit
8ccde9368f
@ -46,8 +46,14 @@ function(compiler_rt_mock_llvm_cmake_config_set_target_triple)
|
||||
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang|GNU")
|
||||
# Note: Clang also supports `-print-target-triple` but gcc doesn't
|
||||
# support this flag.
|
||||
set(DUMPMACHINE_ARG -dumpmachine)
|
||||
if(MSVC)
|
||||
# This means we are using clang-cl and it requires
|
||||
# /clang: as prefix for dumpmachine argument.
|
||||
set(DUMPMACHINE_ARG /clang:-dumpmachine)
|
||||
endif()
|
||||
execute_process(
|
||||
COMMAND "${CMAKE_C_COMPILER}" -dumpmachine
|
||||
COMMAND "${CMAKE_C_COMPILER}" ${DUMPMACHINE_ARG}
|
||||
RESULT_VARIABLE HAD_ERROR
|
||||
OUTPUT_VARIABLE COMPILER_OUTPUT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user