Sysprogs forums › Forums › VisualGDB › Android executable CMake import
- This topic has 11 replies, 2 voices, and was last updated 6 years, 9 months ago by support.
-
AuthorPosts
-
January 16, 2018 at 18:34 #13485robiwanParticipant
I’d like to create an Android project, but I already have a CMake based application (with “main”) which I’d like to use instead creating a new one, is this possible ?
January 18, 2018 at 08:13 #13492supportKeymasterHi,
Sorry, unfortunately that is not directly supported. However as for CMake projects the Solution Explorer contents is dynamically built from the CMake project structure, you can simply copy-paste the CMakeLists.txt file structure to a newly created project (and also copy all relevant sources) and VisualGDB will automatically update Solution Explorer to show the contents of your project.
January 18, 2018 at 16:19 #13502robiwanParticipantOk, sounds interesting, although I’m not sure how to (don’t know which Android project type I need to select f.i.), can you show roughly the steps I need to take ?
January 19, 2018 at 04:30 #13512supportKeymasterHi,
No problem. Please let us know what are you trying to create a – stand-alone command-line Android tool, a native Android app or a Java App with C++ part built by CMake.
January 19, 2018 at 07:53 #13516robiwanParticipantIn this case a stand-alone command-line Android tool (built in C++), I’m also interested in setting up unit tests, but that’s later.
January 20, 2018 at 06:29 #13529supportKeymasterHi,
Thanks for clarifying. This is supported out-of-the-box for the regular ndk-build + Make project type (can be created via the Android Project Wizard), but not yet for CMake. We would advise simply creating a new command-line Android application via VisualGDB wizard and then adding your files to the project. You can also create a unit test project from the same wizard – VisualGDB will automatically setup the unit testing framework and forward the test results from the Android device to Visual Studio.
January 22, 2018 at 10:05 #13541robiwanParticipantThanks, there are a lot of files to add though, that’s why I was hoping for CMake support š Is this planned for the future ?
January 23, 2018 at 06:59 #13554supportKeymasterHi,
Sorry, we currently don’t have specific plans for supporting CMake-based stand-alone Android executables. The good news is that you can easily add multiple files and subdirectories to a VisualGDB project via Add->Add Existing Item->Import Folder Recursively.
January 25, 2018 at 16:29 #13607robiwanParticipantOk,Ā imported all files, now I seem to have a problem with all STL #include <…>Ā directives, adding #include <algorithm> gives:
1>C:\Users\robi\source\repos\AndroidProject1\AndroidProject1\jni\AndroidProject1.c(3,10): error : ‘algorithm’ file not found
Ideas ?
EDIT: Ok, I missed to set toolchain and c++ library š
January 25, 2018 at 18:50 #13610supportKeymasterHi,
Good to know it works. If you encounter further problems, feel free to let us know and we will help.
January 26, 2018 at 16:09 #16035robiwanParticipantThanks, I’m now having a problem. VisualGDB seems to include a lot of c/cpp files that are not present in the solution, leading to a lot of multiply defined symbols, the ones I have problems with are related to googletest/googlemock. F.i. I have
1>[armeabi-v7a] Compile++ thumb: AndroidProject1 <= gmock-all.cc
but gmock-all.cc is nowhere to be found in the solution folder, but it is present in the Android.mk file, which is generated by VisualGDB.
January 30, 2018 at 07:42 #19882supportKeymasterHi,
This looks likeĀ a missing (or incorrectly configured) test framework directory. Normally, VisualGDB would referenceĀ the test framework files as shown below:
LOCAL_SRC_FILES := $(TESTFW_BASE)/com.sysprogs.unittest.googletest/src/gtest-death-test.cc <...>
Then it would pass the TESTFW_BASE variable via environment. Could you please check whetherĀ the LOCAL_SRC_FILES statement uses this syntax? If yes, does setting TESTFW_BASE to $(LOCALAPPDATA)\VisualGDB\TestFrameworks solve the problem?
-
AuthorPosts
- You must be logged in to reply to this topic.