Rain Ger
2018-01-23 16:37:29 UTC
Hi,
I am fairly new to Android development and I am struggling with a C++
linking issue. This is on Windows 10, where we use JNI to call a C++ class
that in turn executes the google unit tests that we have for all our C++
code. Since our application is written in C++ and needs to work on both
Windows and Android, we want to run the same native unit tests on both
platforms. The shared objects are compiled using ndk-build and we are
linking to said .so files using CMake, to be able to run all our unit tests.
By default Android Studio uses `cmd.exe /C ""list-of-all-arguments""` on
Windows to link the shared objects and since there are quite a few, it
blows up past the 8192 cmd.exe character limit.
It seems there is a way to tell cmake to use a "response file" but Android
Studio *still* runs "cmd /c list-of-all-arguments" so it fails the same way
(or I haven't correctly updated the CMakeLists.txt or build.gradle files).
There are apparently ways to configure the `executable` and `args`
parameters in build.gradle but I can't find any useful documentation
describing this, so I am stuck yet again.
How do I get around the issue of the "list-of-all-arguments" imposed by
Android Studio (by insisting on using "cmd.exe /C list-of-all-arguments")?
A quick glance shows that there are 44 .so objects that I need to link but
because of the file locations, including the full path to the cmake.exe and
clang++.exe executables (six references to the full path where ndk-bundle
is located, each is at least 80 characters long so that's around 500
characters right there), the argument passed to "cmd.exe /C" is longer than
8192 characters.
I would really appreciate it if someone could help me get around this
Windows-specific limitation.
Thank you,
R.G.
I am fairly new to Android development and I am struggling with a C++
linking issue. This is on Windows 10, where we use JNI to call a C++ class
that in turn executes the google unit tests that we have for all our C++
code. Since our application is written in C++ and needs to work on both
Windows and Android, we want to run the same native unit tests on both
platforms. The shared objects are compiled using ndk-build and we are
linking to said .so files using CMake, to be able to run all our unit tests.
By default Android Studio uses `cmd.exe /C ""list-of-all-arguments""` on
Windows to link the shared objects and since there are quite a few, it
blows up past the 8192 cmd.exe character limit.
It seems there is a way to tell cmake to use a "response file" but Android
Studio *still* runs "cmd /c list-of-all-arguments" so it fails the same way
(or I haven't correctly updated the CMakeLists.txt or build.gradle files).
There are apparently ways to configure the `executable` and `args`
parameters in build.gradle but I can't find any useful documentation
describing this, so I am stuck yet again.
How do I get around the issue of the "list-of-all-arguments" imposed by
Android Studio (by insisting on using "cmd.exe /C list-of-all-arguments")?
A quick glance shows that there are 44 .so objects that I need to link but
because of the file locations, including the full path to the cmake.exe and
clang++.exe executables (six references to the full path where ndk-bundle
is located, each is at least 80 characters long so that's around 500
characters right there), the argument passed to "cmd.exe /C" is longer than
8192 characters.
I would really appreciate it if someone could help me get around this
Windows-specific limitation.
Thank you,
R.G.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/084f391a-52c3-4e7b-a61c-68eeafdd2072%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/084f391a-52c3-4e7b-a61c-68eeafdd2072%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.