From bf231869c38e1d635c974781357f6ac3de65fb79 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Wed, 19 Dec 2012 15:17:23 +0000 Subject: [ASan] Support building both 32- and 64-bit unit tests if we can target both architectures git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170549 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index bbf41f77..8574cdc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,16 @@ else() set(TARGET_I386_CFLAGS "-m32") endif() +function(get_target_flags_for_arch arch out_var) + if(${arch} STREQUAL "x86_64") + set(${out_var} ${TARGET_X86_64_CFLAGS} PARENT_SCOPE) + elseif(${arch} STREQUAL "i386") + set(${out_var} ${TARGET_I386_CFLAGS} PARENT_SCOPE) + else() + message(FATAL_ERROR "Unsupported architecture: ${arch}") + endif() +endfunction() + # Try to compile a very simple source file to ensure we can target the given # platform. We use the results of these tests to build only the various target # runtime libraries supported by our current compilers cross-compiling -- cgit v1.2.3