Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio, CMake. How to print debug message in compile time?

I'm using Android Studio 2.3 beta 3. I put message(AUTHOR_WARNING "Hello CMake, hello Android") In my CMakeLists.txt

But I saw this message only few times when rebuilding project in Android Studio. In most cases there's no "Hello CMake, hello Android" string in Gradle Console after build finishes. I've tried resync gradle and clean/rebuild project, still no expected output.

I have some problems with my build (I think it's incorrect paths) so my goal - to print CMake variables in compile time to better understand what is actually going on.

like image 616
Alan Kazbekov Avatar asked Feb 14 '17 15:02

Alan Kazbekov


2 Answers

Inside the project tree, you can find the log with all the cmake output inside the folder of each generated architecture. The relative path to the file should be something like:

[project folder]/app/.externalNativeBuild/cmake/debug/arm64-v8a/cmake_build_output.txt

Here you can see all the MESSAGE calls of the cmake scripts.

like image 75
goe Avatar answered Nov 01 '22 05:11

goe


my android studio cmake output:

compile detail:

.cxx/cmake/debug/arm64-v8a/compile_commands.json

cmake output:

.cxx/cmake/debug/arm64-v8a/build_output.txt
like image 10
lbsweek Avatar answered Nov 01 '22 03:11

lbsweek