GithubHelp home page GithubHelp logo

berkus / android-cmake Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 308 KB

Automatically exported from code.google.com/p/android-cmake

CMake 22.32% Diff 0.46% Shell 1.27% C++ 15.90% C 59.97% HTML 0.08%

android-cmake's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ”ญ Iโ€™m currently working on Vesper, a kernel for my new OS.
  • ๐Ÿ”ญ Iโ€™m also building a Voron 2.4R2 3D printer.
  • ๐ŸŒฑ Iโ€™m currently learning FORTH and F#

๐Ÿ’ผ My recent activity:

Rust         6 hrs 41 mins   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   38.38 %
TypeScript   5 hrs 27 mins   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   31.29 %
Java         2 hrs 51 mins   โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   16.40 %
TOML         1 hr 7 mins     โ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   06.41 %
AsciiDoc     51 mins         โ–ˆโ–’โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   04.96 %

android-cmake's People

Contributors

aichim avatar ethanrublee avatar

Watchers

 avatar  avatar

android-cmake's Issues

Compiler version can't be determined with latest NDK

What steps will reproduce the problem?

I use a standalone ndk, but I think it will be a problem with a normal ndk too. 
If I try to use android-cmake, I get errors that no compiler toolchain can be 
determined

CMake Error at 
/Users/lieven/android-cmake/toolchain/android.toolchain.cmake:618 (list):
  list GET given empty list
Call Stack (most recent call first):
  /Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:89 (include)



CMake Error at 
/Users/lieven/android-cmake/toolchain/android.toolchain.cmake:631 (message):
  No one of available compiler toolchains is able to compile for arm
  platform.
Call Stack (most recent call first):
  /Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:89 (include)



CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module 
file:/Users/lieven/Projects/AndroidMatter/CMakeFiles/2.8.10.2/CMakeCCompiler.cma
ke
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module 
file:/Users/lieven/Projects/AndroidMatter/CMakeFiles/2.8.10.2/CMakeCXXCompiler.c
make
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!


What is the expected output? What do you see instead?

It should find the toolchain.

What version of the product are you using? On what operating system?

- max osx 10.7.5
- cmake 2.8.10.2
- android-cmake -> can't find a version number, but I'm quite sure it's the 
latest one.
- android ndk r8d

Please provide any additional information below.

The problem seems to be that the version number of the gcc version in the 
latest NDK is 4.7. The regular expression that tries to extract the gcc version 
expects 3 components (like 4.2.1)

Replacing line 467 

  string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )

with

  string( REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?" __availableToolchainCompilerVersions "${__availableToolchainCompilerVersions}" )

fixes the problem for me.

Original issue reported on code.google.com by [email protected] on 16 Feb 2013 at 4:10

Hello-boost doesn't find the boost installation

What steps will reproduce the problem?
1. follow the documentation to compile the boost common-lib
2. set BOOST_ROOT environment variable to the folder in 1) (path\boost_1_45_0)
3. cmake -G"NMake Makefiles" 
-DCMAKE_TOOLCHAIN_FILE=C:\Users\Emerix\Dropbox\msc\androidcmake\toolchain\androi
d.toolchain.cmake .. 

What is the expected output? What do you see instead?
Expected: Makefile.
Result: CMake Error at 
D:/android/CMake/share/cmake-2.8/Modules/FindBoost.cmake:1192 (message):
  Unable to find the requested Boost libraries.

  Unable to find the Boost header files.  Please set BOOST_ROOT to the root
  directory containing Boost or BOOST_INCLUDEDIR to the directory containing
  Boost's headers.
Call Stack (most recent call first):
  CMakeLists.txt:12 (find_package)


CMake Error: The following variables are used in this project, but they are set
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake file
s:
Boost_INCLUDE_DIR (ADVANCED)
   used as include directory in directory C:/Users/Emerix/Dropbox/msc/androidcma
ke/samples/hello-boost

What version of the product are you using? On what operating system?
newest android-cmake on Windows7 Pro x64, Visual Studio 2010 console.



Original issue reported on code.google.com by [email protected] on 1 Mar 2013 at 11:21

android-toolchain-cmake

Hi,

It seems that the current version of android-toolchain-cmake only supports ARM 
based system. Could you please add x86 support in the near future, as Android-9 
support x86 right now.

By the way, could you please send me an email, because I have several questions 
to ask for your help.

Thank you.

Original issue reported on code.google.com by [email protected] on 22 Aug 2011 at 2:50

Android cmake doesn't work with Android NDK revision 8e

What steps will reproduce the problem?
1. Download Android NDK rev 8e
2. Set Android cmake to use it
3. Watch it crash and burn

What is the expected output? What do you see instead?
Expected for it to just work. It on the other hand just doesn't

What version of the product are you using? On what operating system?
rev 7e4cd91276af on Ubuntu x64

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 25 Mar 2013 at 4:45

CMAKE_FIND_ROOT_PATH causes series of mystical bugs

What steps will reproduce the problem?
1. Write CMakeLists that uses, for example, find_path for some puprose
2. Try to compile the project with android toolchain
3. Discover that your files are searched somewhere inside NDK

What is the expected output? What do you see instead?
Files were found correctly.

I've tried to use the toolchain to compile qt project. find_package (Qt4) just 
works fine usually when I give it path to qmake utility.
Pre-built Qt for android wasn't installed inside NDK directory for some reasons 
by Necessitas installer and I've tried to set QT_QMAKE_EXECUTABLE and 
cross-compile the project in usual way, but CMAKE_FIND_ROOT_PATH makes FindQt4 
module act in mystical way without any warnings.

The solution is to add "/" to the variable.


Original issue reported on code.google.com by [email protected] on 26 Mar 2012 at 1:46

Adding support for r8b -here is the code


edit android.toolchain.cmake

change line 202
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8 -r7c -r7b 
-r7 -r6b -r6 -r5c -r5b -r5 "" )
to
set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r8b -r8 -r7c 
-r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )

change line 476 from
string( REGEX MATCH "[0-9]+.[0-9]+.[0-9]+$" __version "${__toolchain}" )
to
string( REGEX MATCH "([0-9.]+)+$" __version "${__toolchain}" )

reason the new 4.6 toolchain is not named 4.6.0 in r8b

can someone push this chane to the code base please?
Kind Regards
Martell Malone



Original issue reported on code.google.com by [email protected] on 23 Jul 2012 at 1:12

Feature request: llvm / clang

Any chance of updating the toolchain to support clang?

apparently, it's replace CC and CXX in the makefiles with <tool-path>/bin/clang 
and <tool-path>/bin/clang++ and probably add the cmake option 
NDK_TOOLCHAIN_VERSION (clang3.1/gcc4.6/gcc4.7)

Original issue reported on code.google.com by [email protected] on 17 Mar 2013 at 10:10

cmake install_name_tool error on OSX

When using this toolchain on OSX (10.6.8) with CMake 2.8.4, calling it with:

cmake -DANDROID_NDK=blah -DCMAKE_TOOLCHAIN_FILE=blah ..

Will produce the error: 
CMake Error at /path/to/cmake/Modules/CMakeFindBinUtils.cmake:71
Could not find install_name_tool, please check your installation.

To fix this, you need to provide a path to the install_name_tool binary, 
typically located under /usr/bin/install_name_tool. This can be done by adding 
-DCMAKE_INSTALL_NAME_TOOL=/usr/bin/install_name_tool to the calling line.

In the CMake Platform file Darwin.cmake, they simply check for the presence of 
CMAKE_INSTALL_NAME_TOOL and if not found, they call a find_program to locate 
it. It seems like a reasonable fix to add this to the android.toolchain.cmake 
file, as in the example patch below.

@@ -164,6 +164,11 @@
   message( FATAL_ERROR "Your platform is not supported" )
  endif()

+ # On some platforms (OSX) this may not be defined, so search for it
+ if( NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+  find_program( CMAKE_INSTALL_NAME_TOOL install_name_tool)
+ endif( NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+
  set( ANDROID_API_LEVEL $ENV{ANDROID_API_LEVEL} )
  string( REGEX REPLACE "[\t ]*android-([0-9]+)[\t ]*" "\\1" ANDROID_API_LEVEL "${ANDROID_API_LEVEL}" )
  string( REGEX REPLACE "[\t ]*([0-9]+)[\t ]*" "\\1" ANDROID_API_LEVEL "${ANDROID_API_LEVEL}" )


Original issue reported on code.google.com by [email protected] on 19 Aug 2011 at 3:44

Compiler flags not passed to assembler

What steps will reproduce the problem?
1. Make a project with both C sources and assembler sources, where some 
assembler code is conditionally compiled out (e.g. NEON code if not compiling 
for ARM-v7+), and the C code calls this code
2. Try to compile this project with ANDROID_ABI set to ARMEABI_V7A or greater

What is the expected output? What do you see instead?

Expected: no errors
Actual: The assembler object file has NEON code compiled out even though the 
ANDROID_ABI was set correctly

What version of the product are you using? On what operating system?

Latest version grabbed from Github: https://github.com/taka-no-me/android-cmake

Please provide any additional information below.

Attached a patch that fixed the problem for me. It simply adds 
ANDROID_CXX_FLAGS to CMAKE_ASM_FLAGS. Not sure if this will work for all 
toolchains. It should since CMAKE_ASM_COMPILER is only ever set to gcc.


Original issue reported on code.google.com by daiweili on 12 Feb 2014 at 2:38

Attachments:

Could not uniquely determine machine name

What steps will reproduce the problem?
Use the latest android.toolchain.cmake script with Android NDK r8c!

What do you see instead?
A couple of warnings (but they are all the same):
CMake Warning at /home/jumio/workspace/ocr/scripts/android.toolchain.cmake:318 
(message):
  Could not uniquely determine machine name for compiler from
  /opt/build-tools/android-ndk-r8c/toolchains/mipsel-linux-android-clang3.1/prebuilt/linux-x86.
Call Stack (most recent call first):
  /home/jumio/workspace/ocr/scripts/android.toolchain.cmake:481 (__DETECT_TOOLCHAIN_MACHINE_NAME)
  /home/jumio/workspace/ocr/build/CMakeFiles/CMakeSystem.cmake:1 (INCLUDE)
  CMakeLists.txt:3 (PROJECT)

What version of the product are you using? On what operating system?
latest, on Ubuntu 10.10


Original issue reported on code.google.com by [email protected] on 16 Nov 2012 at 12:11

make-standalone-toolchain.sh

What steps will reproduce the problem?
1. Using cygwin terminal, I run the make-standalone-toolchain script:

This is tha command I write:
$ sh make-standalone-toolchain.sh --ndk-dir=$NDK --platform=android-9 \ 
--install-dir=$ANDROID_SDK/android-toolchain

This is the output for the script:
Auto-config: --toolchain=arm-linux-androideabi-4.4.3
Copying prebuilt binaries...
Copying sysroot headers and libraries...
Copying libstdc++ headers and libraries...
mkdir: cannot create directory 
`/tmp/ndk-ayesh/tmp/build-5788/standalone/arm-linux-androideabi-4.4.3/arm-linux-
androideabi': Permission denied
ERROR: Cannot copy to directory: 
/tmp/ndk-ayesh/tmp/build-5788/standalone/arm-linux-androideabi-4.4.3/arm-linux-a
ndroideabi/include/c++/4.4.3


What version of the product are you using? On what operating system?
windows-7-x64, ndk-r7b, and cygwin.

Additional information:
I'm using cygwin on windows-7-x64, and the most important question is, am I 
waiting my time and should give up on windows with cygwin and use linux instead?

Original issue reported on code.google.com by [email protected] on 27 May 2012 at 1:43

try_compile fix causes new issues

Thank you guys for your efforts developing this toolchain file, and thanks for 
your recent update supporting ndk r7.  With the update, I was able to make a 
KiwiViewer build using ndk-r7b, which includes a build of vtk, ves, and curl, 
and links with gnustl and glesv2.


I did run into a problem with try_compile though.  Here is a simple 
CMakeLists.txt that demonstrates the problem:


cmake_minimum_required(VERSION 2.8.6)
project(MyTest)

include(TestForSTDNamespace)

if (NOT CMAKE_STD_NAMESPACE)
  message(FATAL_ERROR "Failed to find STD namespace")
endif()



This fails for me when using the android toolchain file. If you look at 
CMakeFiles/CMakeError.log in the build directory, you'll see that the try 
compile command invokes the compiler without the required system include 
directories:


/path/to/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-
x86/bin/arm-linux-androideabi-g++    
--sysroot=/source/android/android-ndk-r7b/platforms/android-8/arch-arm 
-fsigned-char -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -fPIC -Wno-psabi 
-frtti -fexceptions     -o 
CMakeFiles/cmTryCompileExec.dir/TestForSTDNamespace.cxx.o -c 
/opt/local/share/cmake-2.8/Modules/TestForSTDNamespace.cxx
/opt/local/share/cmake-2.8/Modules/TestForSTDNamespace.cxx:1:16: error: list: 
No such file or directory
/opt/local/share/cmake-2.8/Modules/TestForSTDNamespace.cxx: In function 'int 
main(int, char**)':
/opt/local/share/cmake-2.8/Modules/TestForSTDNamespace.cxx:4: error: 'list' is 
not a member of 'std'



If I remove the try_compile fix from the toolchain file then everything works 
for me.  I removed the lines:

if( PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
 # all needed flags and variables are already inherited from the parent project
 return()
endif()

Original issue reported on code.google.com by [email protected] on 4 Mar 2012 at 4:49

Please support latest ndk , r6+

I see that current version was tested on r5

http://code.google.com/p/android-cmake/source/browse/toolchain/android.toolchain
.cmake

I know that r5 had some bugs :

http://groups.google.com/group/android-ndk/browse_thread/thread/64d74459c5a28855


so supporting r6 would be better since it's the latest one

As a side note maybe it should use /usr/local/opt or ${HOME}/opt/ ...


* * * * 

diff -r 5c8899b988d6 toolchain/android.toolchain.cmake
--- a/toolchain/android.toolchain.cmake Sat Apr 30 07:50:56 2011 -0700
+++ b/toolchain/android.toolchain.cmake Wed Aug 03 16:11:05 2011 +0100
@@ -92,7 +92,7 @@
 #this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

-set( ANDROID_NDK_DEFAULT_SEARCH_PATH /opt/android-ndk-r5b )
+set( ANDROID_NDK_DEFAULT_SEARCH_PATH /opt/android-ndk-r6 )
 set( ANDROID_NDK_TOOLCHAIN_DEFAULT_SEARCH_PATH /opt/android-toolchain )
 set( TOOL_OS_SUFFIX "" )



Original issue reported on code.google.com by www.rzr.online.fr on 3 Aug 2011 at 3:12

Debug build type does not pass debug flag to GCC

Giving -DCMAKE_BUILD_TYPE=Debug, when configuring on the console, creates a 
debug configuration. This would cause, when building, to pass to the compiler 
the options in CMAKE_CXX_FLAGS_DEBUG and CMAKE_C_FLAGS_DEBUG for C++ and C 
respectively. Neither of these contain flags to produce debug symbols. 
Shouldn't they contain "-g"?
Also on a side note in Debug, a flag for size optimization is pass, shouldn't 
it be "-O0" for no optimization?

Original issue reported on code.google.com by [email protected] on 4 Sep 2012 at 1:22

Build fails at linking step.

On a Windows 7 computer:

What steps will reproduce the problem?
1. Install mingw32-make if you do not have it: 
http://sourceforge.net/projects/mingw/files/MinGW/Extension/make/mingw32-make-3.
80-3/mingw32-make-3.80.0-3.exe/download
2. Download and unzip 
https://dl.dropbox.com/u/40949268/Bugs/NativeActivityCMakeLists.zip
3. Edit the android_cmake.bat file to point -DCMAKE_TOOLCHAIN_FILE to the 
location of the toolchain on your system.
4. Run android_cmake.bat
5. Run mingw32-make.

What is the expected output? What do you see instead?

Build should finish ok and produce a .so file.

The result looks like follows:

https://dl.dropbox.com/u/40949268/Bugs/androidcmake.png

Somehow cmake seems to be joining the two filenames into one, i.e treating the 
string "file1.c file2." as one file, instead of two separate files?

Original issue reported on code.google.com by [email protected] on 19 Jun 2012 at 5:06

[PATCH] Use link_libraries for libstdc++ and libsupc++

Hey,

This patch changes the toolchain file so that it links to libstdc++ and 
libsupc++ using link_libraries instead of CMAKE_*_LINKER_FLAGS. You'll notice 
that it also switches them around.

The reason this is needed is to fix issues arising when you try to link a 
program with a library built using ndk-build. I've attached a small test case 
reproducing the problem; in builds.sh you'll find several examples of build 
command lines. You'll see that putting the libraries before the object files 
(which using CMAKE_*_LINKER_FLAGS will naturally do) doesn't work, and putting 
the libraries in the other order doesn't work either. Thus, we need to use 
link_libraries (which puts the -l options after the object files), and change 
the libraries' order.

Just in case, I'm using a standalone toolchain extracted from NDK r8b.

Original issue reported on code.google.com by [email protected] on 9 Aug 2012 at 11:18

Attachments:

cmake generates bad builds on Windows which crash when run on ICS, but work on Honeycomb.

I am developing a NativeActivity application for Android tablets, and I'm 
getting bit by this issue pretty bad. What happens is that when I use 
android-cmake for the build, I can produce .apk fine, and it loads and starts 
up. On Honeycomb tablets, the .apk works correctly, but on ICS, the .apk 
crashes immediately on a call to pthread_mutex_unlock() in native_app_glue.c 
that is provided by Android NDK. The log file is at 

https://dl.dropbox.com/u/40949268/Bugs/cmakeNativeActivityCrash.txt

You can see my custom traces, the file I compiled is at

https://dl.dropbox.com/u/40949268/Bugs/android_native_app_glue.c

I am trying to produce a minimal sample to exhibit this issue, and therefore 
generated the file

https://dl.dropbox.com/u/40949268/Bugs/NativeActivityCMakeLists.zip

However, due to another issue (see 
http://code.google.com/p/android-cmake/issues/detail?id=8 ), I have not been 
able to yet test this minimal sample. I'll need to resolve that issue first.

Has anyone observed anything similar when building NativeActivity applications 
with android_native_app_glue.c for Ice Cream Sandwich using android-cmake?

Original issue reported on code.google.com by [email protected] on 19 Jun 2012 at 5:15

Can we remove "-fdata-sections -ffunction-sections"

See here: http://sourceforge.net/p/log4cplus/mailman/message/31286406/

What steps will reproduce the problem?
1. Compile logcplus 1.2 in Andriod using cmake
2. Choose the Release version(Debug works fine)
3. encounter error log4cplus::internal::__emutls_t._ZN9log4cplus8internal3ptdE 
causes a section type conflict

What is the expected output? What do you see instead?

Should works fine for release version.

What version of the product are you using? On what operating system?

I'm using mac to cross compile the log4cplus for android, and ndk using is  
android-ndk-r9d, toolchain is arm-linux-androideabi-g++ (GCC) 4.6 20120106 
(prerelease)

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 4 May 2014 at 3:45

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.