diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-12-19 15:17:23 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-12-19 15:17:23 +0000 |
commit | bf231869c38e1d635c974781357f6ac3de65fb79 (patch) | |
tree | 222a2e8e43f2986c7118b854529587163af4204d /CMakeLists.txt | |
parent | e3091193af47f4932b42ba1773416dfeb3aa2e87 (diff) | |
download | compiler-rt-bf231869c38e1d635c974781357f6ac3de65fb79.tar.gz compiler-rt-bf231869c38e1d635c974781357f6ac3de65fb79.tar.bz2 compiler-rt-bf231869c38e1d635c974781357f6ac3de65fb79.tar.xz |
[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
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
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 |