[ASan/Win] Add DLL thunks for __asan_{,un}poison_memory_region
[blocksruntime.git] / cmake / Modules / CompilerRTCompile.cmake
blob2794cabe59c57113dcce9aafdc9d156ab083cc34
1 include(LLVMParseArguments)
3 # Compile a source into an object file with just-built Clang using
4 # a provided compile flags and dependenices.
5 # clang_compile(<object> <source>
6 #               CFLAGS <list of compile flags>
7 #               DEPS <list of dependencies>)
8 macro(clang_compile object_file source)
9   parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN})
10   get_filename_component(source_rpath ${source} REALPATH)
11   add_custom_command(
12     OUTPUT ${object_file}
13     COMMAND clang ${SOURCE_CFLAGS} -c -o "${object_file}" ${source_rpath}
14     MAIN_DEPENDENCY ${source}
15     DEPENDS clang ${SOURCE_DEPS})
16 endmacro()