On 10/11/2016 16:05, Ruslan Baratov via cmake-developers wrote:
Hi,
I wonder if it's possible to introduce next variables describing Android
tools:
* C preprocessor. Similar to CMAKE_CXX_COMPILER the variable that will
contain the path to preprocessor. Example:
* CMAKE_CXX_COMPILER =
<ndk-root>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++
* CMAKE_C_PREPROCESSOR =
<ndk-root>/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
* ANDROID_TOOLCHAIN_MACHINE_NAME. In fact I'm not sure what this
variable mean but it's an important part of move from taka-no-me
toolchain to CMake 3.7. I guess it's like
* CMAKE_CXX_COMPILER =
<ndk-root>/toolchains/${ANDROID_TOOLCHAIN_MACHINE_NAME}-4.9/prebuilt/linux-x86_64/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-g++
Of course if I'm not missing something and they are not already somewhere :)
Ruslo
How about ${CMAKE_C/CXX_COMPILER} -E to call the preprocessor? Calling
it directly is kind of dangerous though since you will probably be
missing the proper language information and other options that might
affect the predefined preprocessor defines. gcc has different binaries
for different target archs and has some defines baked in, but this won't
apply to Clang that uses only one binary and a target triple. You'll
also lose the c/c++ language definition (unless you pass -x c++),
language standard in use...
gcc (or clang) are just "drivers". They will call the proper programs
automatically. Either the preprocessor, the compiler (cc1) or the
linker, so you should be able to do everything with it directly!
As for the ANDROID_TOOLCHAIN_MACHINE_NAME that is used for gcc prefix,
it shouldn't be needed. If you rely on gcc, you should investigate on
using Clang which is the supported compiler now in the NDK. What is your
exact usage of the variable?
/Florent
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers