summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-11-29 19:27:25 +0000
committerKuba Mracek <mracek@apple.com>2017-11-29 19:27:25 +0000
commit0a7288064854a3ff716d928a0ab72fdd2bbddb72 (patch)
tree81d7453cf3a8ab393d237a36826baf7546699664 /cmake/Modules
parent17c071e3dcbb1ee6d107a12096ec26750fb816c0 (diff)
[sanitizer] Refactor how assembly files are handled
This renames ASM_TSAN_SYMBOL and ASM_TSAN_SYMBOL_INTERCEPTOR to just ASM_SYMBOL and ASM_SYMBOL_INTERCEPTOR, because they can be useful in more places than just TSan. Also introduce a CMake function to add ASM sources to a target. Differential Revision: https://reviews.llvm.org/D40143 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index c50afbcab..8f9857923 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -93,6 +93,17 @@ function(add_compiler_rt_component name)
add_dependencies(compiler-rt ${name})
endfunction()
+function(add_asm_sources output)
+ set(${output} ${ARGN} PARENT_SCOPE)
+ # Xcode will try to compile asm files as C ('clang -x c'), and that will fail.
+ if (${CMAKE_GENERATOR} STREQUAL "Xcode")
+ enable_language(ASM)
+ else()
+ # Pass ASM file directly to the C++ compiler.
+ set_source_files_properties(${ARGN} PROPERTIES LANGUAGE C)
+ endif()
+endfunction()
+
macro(set_output_name output name arch)
if(ANDROID AND ${arch} STREQUAL "i386")
set(${output} "${name}-i686${COMPILER_RT_OS_SUFFIX}")