From ebef3632c79491c402991967aab03a9c971cb70d Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 6 Oct 2016 11:43:24 -0400 Subject: Android: Suppress -Wattributes warnings in test case builds We use `-Werror` in the Android test builds to make sure there are no warnings that we care about (e.g. unused flags). However, the NDK r13 tools produce a warning about their own builtins: ``` : In function 'float abs(float)': : warning: conflicts with previous declaration here [-Wattributes] ``` Suppress this warning so that we can continue using `-Werror` but tolerate these warnings. --- Tests/RunCMake/Android/common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index 7eac5d6..6ea0909 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -17,8 +17,8 @@ foreach(f endif() endforeach() -string(APPEND CMAKE_C_FLAGS " -Werror") -string(APPEND CMAKE_CXX_FLAGS " -Werror") +string(APPEND CMAKE_C_FLAGS " -Werror -Wno-attributes") +string(APPEND CMAKE_CXX_FLAGS " -Werror -Wno-attributes") string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-no-undefined") if(CMAKE_ANDROID_NDK) -- cgit v0.12 From 0c3a04777cc5fa8bc43b57b789e72630781ef56a Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 6 Oct 2016 11:50:29 -0400 Subject: Android: Update libc++ include directories for NDK r13 The Android NDK r13 moved the libc++ include directories. Closes: #16346 --- Modules/Platform/Android/ndk-stl-c++.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Android/ndk-stl-c++.cmake b/Modules/Platform/Android/ndk-stl-c++.cmake index 14748a1..cb9fd68 100644 --- a/Modules/Platform/Android/ndk-stl-c++.cmake +++ b/Modules/Platform/Android/ndk-stl-c++.cmake @@ -3,7 +3,13 @@ set(_ANDROID_STL_RTTI 1) set(_ANDROID_STL_EXCEPTIONS 1) macro(__android_stl_cxx lang filename) # Add the include directory. - __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" 1) + if(EXISTS "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include/cstddef") + # r12 and below + __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/libcxx/include" 1) + else() + # r13 and above + __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/cxx-stl/llvm-libc++/include" 1) + endif() # Add a secondary include directory if it exists. __android_stl_inc(${lang} "${CMAKE_ANDROID_NDK}/sources/android/support/include" 0) -- cgit v0.12