summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTCompile.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/CompilerRTCompile.cmake')
-rw-r--r--cmake/Modules/CompilerRTCompile.cmake10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake
index 2794cabe5..bb2d08018 100644
--- a/cmake/Modules/CompilerRTCompile.cmake
+++ b/cmake/Modules/CompilerRTCompile.cmake
@@ -1,6 +1,6 @@
include(LLVMParseArguments)
-# Compile a source into an object file with just-built Clang using
+# Compile a source into an object file with COMPILER_RT_TEST_COMPILER using
# a provided compile flags and dependenices.
# clang_compile(<object> <source>
# CFLAGS <list of compile flags>
@@ -8,9 +8,13 @@ include(LLVMParseArguments)
macro(clang_compile object_file source)
parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN})
get_filename_component(source_rpath ${source} REALPATH)
+ if(NOT COMPILER_RT_STANDALONE_BUILD)
+ list(APPEND SOURCE_DEPS clang)
+ endif()
add_custom_command(
OUTPUT ${object_file}
- COMMAND clang ${SOURCE_CFLAGS} -c -o "${object_file}" ${source_rpath}
+ COMMAND ${COMPILER_RT_TEST_COMPILER} ${SOURCE_CFLAGS} -c -o "${object_file}"
+ ${source_rpath}
MAIN_DEPENDENCY ${source}
- DEPENDS clang ${SOURCE_DEPS})
+ DEPENDS ${SOURCE_DEPS})
endmacro()