[llvm-commits] [PATCH] CMake build rules from asan android runtime and tests

Evgeniy Stepanov eugeni.stepanov at gmail.com
Thu Sep 6 06:54:46 PDT 2012


Hi,

these patches simplify building asan runtime and tests for android. We
remove all custom cflags and custom_command(s) out of individual
CMakeLists (for now, this is done under if(ANDROID), but we'd like to
do the same for x86 and x86_64 and the rest in the future). Instead,
we add a CMake toolchain file in cmake/platforms that describes how to
invoke a particular compiler.

With this, asan tests can be compiled in a second build tree like this:
mkdir build; cd build; cmake ..; make
mkdir android; cd android
cmake -DLLVM_ANDROID_TOOLCHAIN_DIR=/path/to/android/ndk
-DCMAKE_TOOLCHAIN_FILE=../../cmake/platforms/Android.cmake ../..
make AsanUnitTests

Does this look like the right direction? Two build trees definitely
add some complexity to the build process (which can be reduced
eventually by auto-generating the second build tree depending on
available toolchains/configurations). The alternative is forcing a
custom compiler as we do in
projects/compiler-rt/lib/asan/tests/CMakeLists.txt, but that's clearly
an abuse of the build system.

https://codereview.appspot.com/6506080
https://codereview.appspot.com/6499083
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm.patch
Type: application/octet-stream
Size: 836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120906/5c7a68a7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: compiler-rt.patch
Type: application/octet-stream
Size: 5413 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120906/5c7a68a7/attachment-0001.obj>


More information about the llvm-commits mailing list