Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I perform "Build/Refresh Linked C++ Projects" from command line?

I have an Android/NDK application and a build script which uses gradlew.bat to automate build/install.

The build.gradle uses CMakeLists.txt and GLOB_RECURSE internally in order to build the C++ files. However, if I add a new .cpp file to my C++ source code directory, I have to manually start Android Studio and run "Build/Refresh Linked C++ Projects", otherwise the buildscript will not pick up the added .cpp files and I get linker errors.

I would like to have the buildscript to perform the "Refresh Linked C++ Projects" action, but I cannot find a Gradle task which performs this.

Does anyone know how I can perform this action, with or without Gradle, from command line?

like image 831
Viktor Sehr Avatar asked Nov 17 '22 04:11

Viktor Sehr


1 Answers

A workaround would be delete your CMakeCache.txt before executing other tasks. This will force the CMake to regenerate building files.

like image 84
Yingjie Ye Avatar answered Dec 16 '22 00:12

Yingjie Ye