Issue
I have an Android project that has an NDK component, configured to be built with CMake. And depending on where the project dir is located on a drive, I may get a "Command line too long." error when CMake is trying to build this project. It's because CMake assembles huge command lines listing all the .cpp files in a project.
I read that CMake has a mechanism called "response files" to work around this, but I can't find a way to enable them in an NDK project. A little advice, please?
Solution
You can specify response file in CMakeLists.txt, or in build.gradle, add
android { defaultConfig { ...
externalNativeBuild {
cmake {
arguments
"-DCMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS=1",
"-DCMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS=1" ,
"-DCMAKE_C_RESPONSE_FILE_LINK_FLAG=@",
"-DCMAKE_CXX_RESPONSE_FILE_LINK_FLAG=@",
"-DCMAKE_NINJA_FORCE_RESPONSE_FILE=1"
}
}
}}
Answered By - Alex Cohn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.