Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for Android in Mac Fail #54

Closed
jamesguo opened this issue Aug 4, 2013 · 14 comments
Closed

Build for Android in Mac Fail #54

jamesguo opened this issue Aug 4, 2013 · 14 comments

Comments

@jamesguo
Copy link

jamesguo commented Aug 4, 2013

I changed something in android-config.cmake like this

set(ANDROID_TOOLCHAIN_PATH "/Users/James/Work/adt-bundle-mac-x86_64- 20130717/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/ darwin-x86_64/arm-linux-androideabi/bin") set(CMAKE_C_COMPILER ${ANDROID_TOOLCHAIN_PATH}/gcc) set(CMAKE_CXX_COMPILER ${ANDROID_TOOLCHAIN_PATH}/g++) set(CMAKE_ASM_COMPILER ${ANDROID_TOOLCHAIN_PATH}/as)

then after make got an error:

James-AirtekiMacBook-Air:build James$ cmake -DCMAKE_TOOLCHAIN_FILE=/Users/James/Work/Ne10-master/
android/android_config.cmake ..
-- The C compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: /Users/James/Work/adt-bundle-mac-x86_64-20130717/
android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/
arm-linux-androideabi/bin/as
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
loaded toolchain:
OFF/arm-linux-androideabi-gcc
OFF/arm-linux-androideabi-g++
OFF/arm-linux-androideabi-as
OFF/arm-linux-androideabi-ar
OFF/arm-linux-androideabi-ranlib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/James/Work/Ne10-master/build
James-AirtekiMacBook-Air:build James$ make
Scanning dependencies of target NE10
[ 1%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o
gcc: error trying to exec 'cc1': execvp: No such file or directory

make[2]: *** [modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o] Error 1
make[1]: *** [modules/CMakeFiles/NE10.dir/all] Error 2
make: *** [all] Error 2
James-AirtekiMacBook-Air:build James$

@zhongweiy
Copy link
Collaborator

Hi, James, the problem is your modification doesn't change sysroot path. And here is a simpler hack:

  • change line 69 of android/android_config.cmake to:
    set(ANDROID_TOOLCHAIN_PATH "$ENV{ANDROID_NDK}/toolchains/arm-linux-androideabi-${ARM_ANDROID_TOOLCHAIN_VERSION}/prebuilt/darwin-x86_64/bin")
  • And set the environment variable $ANDROID_NDK to your ndk path:
    $export ANDROID_NDK=/Users/James/Work/adt-bundle-mac-x86_64-20130717/android-ndk-r9

Hope it will work and feel free to post any other problem. I'll update this fix to master branch later.

@jamesguo
Copy link
Author

jamesguo commented Aug 5, 2013

get another error

set(ANDROID_TOOLCHAIN_PATH "$ENV{ANDROID_NDK}/toolchains/arm-linux-androideabi-${ARM_ANDROID_TOOLCHAIN_VERSION}/prebuilt/darwin-x86_64/bin")

#change toolchain name according to your configuration
set(CMAKE_C_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-gcc)
set(CMAKE_CXX_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-g++)
set(CMAKE_ASM_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-as)

# Skip the platform compiler checks for cross compiling
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_ASM_COMPILER_WORKS TRUE)

find_program(CMAKE_AR NAMES "${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-ar")
mark_as_advanced(CMAKE_AR)

find_program(CMAKE_RANLIB NAMES "${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-ranlib")
mark_as_advanced(CMAKE_RANLIB)

Scanning dependencies of target NE10
[ 1%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o
clang: warning: argument unused during compilation: '-mthumb-interwork'
clang: warning: argument unused during compilation: '-mfloat-abi=softfp'
clang: warning: argument unused during compilation: '-mfpu=vfp3'

error: unknown target CPU 'armv7-a'

@zhongweiy
Copy link
Collaborator

Could you post the verbose result of make? Like by running:
$VERBOSE=1 make

@jamesguo
Copy link
Author

jamesguo commented Aug 6, 2013

James-AirtekiMacBook-Air:build James$ VERBOSE=1 make
"/Applications/CMake 2.8-11.app/Contents/bin/cmake" -H/Users/James/Work/Ne10-master -B/Users/James/Work/Ne10-master/build --check-build-system CMakeFiles/Makefile.cmake 0
"/Applications/CMake 2.8-11.app/Contents/bin/cmake" -E cmake_progress_start /Users/James/Work/Ne10-master/build/CMakeFiles /Users/James/Work/Ne10-master/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make -f modules/CMakeFiles/NE10.dir/build.make modules/CMakeFiles/NE10.dir/depend
cd /Users/James/Work/Ne10-master/build && "/Applications/CMake 2.8-11.app/Contents/bin/cmake" -E cmake_depends "Unix Makefiles" /Users/James/Work/Ne10-master /Users/James/Work/Ne10-master/modules /Users/James/Work/Ne10-master/build /Users/James/Work/Ne10-master/build/modules /Users/James/Work/Ne10-master/build/modules/CMakeFiles/NE10.dir/DependInfo.cmake --color=
make -f modules/CMakeFiles/NE10.dir/build.make modules/CMakeFiles/NE10.dir/build
"/Applications/CMake 2.8-11.app/Contents/bin/cmake" -E cmake_progress_report /Users/James/Work/Ne10-master/build/CMakeFiles 1
[ 1%] Building C object modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o
cd /Users/James/Work/Ne10-master/build/modules && /usr/bin/cc -DNE10_ENABLE_DSP -DNE10_ENABLE_IMGPROC -DNE10_ENABLE_MATH -O2 -mthumb-interwork -march=armv7-a -mfloat-abi=softfp -mfpu=vfp3 --sysroot= -I/Users/James/Work/Ne10-master/inc -I/Users/James/Work/Ne10-master/common -o CMakeFiles/NE10.dir/math/NE10_abs.c.o -c /Users/James/Work/Ne10-master/modules/math/NE10_abs.c
clang: warning: argument unused during compilation: '-mthumb-interwork'
clang: warning: argument unused during compilation: '-mfloat-abi=softfp'
clang: warning: argument unused during compilation: '-mfpu=vfp3'
error: unknown target CPU 'armv7-a'
make[2]: *** [modules/CMakeFiles/NE10.dir/math/NE10_abs.c.o] Error 1
make[1]: *** [modules/CMakeFiles/NE10.dir/all] Error 2
make: *** [all] Error 2

@jamesguo
Copy link
Author

jamesguo commented Aug 6, 2013

in android.cmake
set(NDK_SYSROOT_PATH "$ENV{ANDROID_NDK}/platforms/android-14/arch-arm/")
this path has no armv7-a
but in my NDK
/Users/James/Work/adt-bundle-mac-x86_64-20130717/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64/arm-linux-androideabi/lib/armv7-a

@zhongweiy
Copy link
Collaborator

Hi, James,
I think the problem is here:

cd /Users/James/Work/Ne10-master/build/modules && /usr/bin/cc -DNE10_ENABLE_DSP -DNE10_ENABLE_IMGPROC -DNE10_ENABLE_MATH -O2 -mthumb-interwork -march=armv7-a -mfloat-abi=softfp -mfpu=vfp3 --sysroot= -I/Users/James/Work/Ne10-master/inc -I/Users/James/Work/Ne10-master/common -o CMakeFiles/NE10.dir/math/NE10_abs.c.o -c /Users/James/Work/Ne10-master/modules/math/NE10_abs.c

The make doesn't call correct compiler, it calles:

/usr/bin/cc

But it should call:

${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-gcc

if the configuration is correct.
I can't reproduce your error in my environment, maybe you can clear your build directory completely and give a try again. And your cmake output may also show some related information about your configuration.

@jamesguo
Copy link
Author

jamesguo commented Aug 7, 2013

when cmke android.cmake , it return

loaded toolchain:
OFF/arm-linux-androideabi-gcc
OFF/arm-linux-androideabi-g++
OFF/arm-linux-androideabi-as
OFF/arm-linux-androideabi-ar
OFF/arm-linux-androideabi-ranlib

is that correct

@jamesguo jamesguo closed this as completed Aug 7, 2013
@jamesguo jamesguo reopened this Aug 7, 2013
@zhongweiy
Copy link
Collaborator

Yeah, the cmake output is right. It's strange that you can't build it. Maybe you can try it under a completely clear build environment again, because cmake would cache some variable in files such as CMakeCache.txt etc.

@jamesguo
Copy link
Author

jamesguo commented Aug 7, 2013

i think my CMakeCache.txt created error ,but i dont konw why

//android platform
ANDROID_PLATFORM:BOOL=ON
//Android toolchain path
ANDROID_TOOLCHAIN_PATH:BOOL=OFF
//Path to a program.

CMAKE_AR:FILEPATH=/usr/bin/ar

//ASM compiler.

CMAKE_ASM_COMPILER:FILEPATH=/usr/bin/cc

//Flags used by the assembler during all build types.
CMAKE_ASM_FLAGS:STRING=
//Flags used by the assembler during debug builds.
CMAKE_ASM_FLAGS_DEBUG:STRING=-g
//Flags used by the assembler during release minsize builds.
CMAKE_ASM_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the assembler during release builds.
CMAKE_ASM_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the assembler during Release with Debug Info builds.
CMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//C compiler.

CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc

//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g
//Flags used by the compiler during release minsize builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the compiler during Release with Debug Info builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
//Flags used by the linker.
CMAKE_EXE_LINKER_FLAGS:STRING=' '
//Flags used by the linker during debug builds.
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
//Path to a program.
CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Path to a program.
CMAKE_LINKER:FILEPATH=/usr/bin/ld
//Path to a program.
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
//Flags used by the linker during the creation of modules.
CMAKE_MODULE_LINKER_FLAGS:STRING=' '
//Flags used by the linker during debug builds.
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Path to a program.
CMAKE_NM:FILEPATH=/usr/bin/nm
//Path to a program.
CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND
//Path to a program.
CMAKE_OBJDUMP:FILEPATH=CMAKE_OBJDUMP-NOTFOUND
//Build architectures for OSX
CMAKE_OSX_ARCHITECTURES:STRING=
//Minimum OS X version to target for deployment (at runtime); newer
// APIs weak linked. Set to empty string for default value.
CMAKE_OSX_DEPLOYMENT_TARGET:STRING=
//The product will be built against the headers and libraries located
// inside the indicated SDK.
CMAKE_OSX_SYSROOT:STRING=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=NE10
//Path to a program.
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
//Flags used by the linker during the creation of dll's.
CMAKE_SHARED_LINKER_FLAGS:STRING=' '
//Flags used by the linker during debug builds.
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
//Flags used by the linker during release minsize builds.
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
//Flags used by the linker during release builds.
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
//Flags used by the linker during Release with Debug Info builds.
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//If set, runtime paths are not added when installing shared libraries,
// but are added when building.
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
//If set, runtime paths are not added when using shared libraries.
CMAKE_SKIP_RPATH:BOOL=NO
//Path to a program.
CMAKE_STRIP:FILEPATH=/usr/bin/strip
//No help, variable specified on the command line.
CMAKE_TOOLCHAIN_FILE:UNINITIALIZED=
//If true, cmake will use relative paths in makefiles and projects.
CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
//If this value is on, makefiles will be generated without the
// .SILENT directive, and all commands will be echoed to the console
// during the make. This is useful for debugging only. With Visual
// Studio IDE projects all commands are done without /nologo.
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
//Value Computed by CMake
NE10_BINARY_DIR:STATIC=/Users/James/Work/Ne10-master/build
//Build NE10 examples
NE10_BUILD_EXAMPLES:BOOL=ON
//Build NE10 shared libraries
NE10_BUILD_SHARED:BOOL=OFF
//Build NE10 static libraries
NE10_BUILD_STATIC:BOOL=ON
//Build NE10 unit test
NE10_BUILD_UNIT_TEST:BOOL=OFF
//Build dsp functionalities to NE10
NE10_ENABLE_DSP:BOOL=ON
//Build image processing functionalities to NE10
NE10_ENABLE_IMGPROC:BOOL=ON
//Build math functionalities to NE10
NE10_ENABLE_MATH:BOOL=ON
//Dependencies for target
NE10_LIB_DEPENDS:STATIC=
//Value Computed by CMake
NE10_SOURCE_DIR:STATIC=/Users/James/Work/Ne10-master
//ADVANCED property for variable: CMAKE_AR
CMAKE_AR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_COMPILER
CMAKE_ASM_COMPILER-ADVANCED:INTERNAL=1
CMAKE_ASM_COMPILER_WORKS:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_FLAGS
CMAKE_ASM_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_FLAGS_DEBUG
CMAKE_ASM_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_FLAGS_MINSIZEREL
CMAKE_ASM_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_FLAGS_RELEASE
CMAKE_ASM_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_ASM_FLAGS_RELWITHDEBINFO
CMAKE_ASM_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_BUILD_TOOL
CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
//What is the target build tool cmake is generating for.
CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/make
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=/Users/James/Work/Ne10-master/build
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=11
//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=/Applications/CMake 2.8-11.app/Contents/bin/cmake
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=/Applications/CMake 2.8-11.app/Contents/bin/cpack
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=/Applications/CMake 2.8-11.app/Contents/bin/ctest
//ADVANCED property for variable: CMAKE_C_COMPILER
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=/Applications/CMake 2.8-11.app/Contents/bin/ccmake
//Executable file format
CMAKE_EXECUTABLE_FORMAT:INTERNAL=Unknown
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Unix Makefiles
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Start directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/Users/James/Work/Ne10-master
//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL
CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=3
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
CMAKE_OBJDUMP-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_RANLIB
CMAKE_RANLIB-ADVANCED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=/Applications/CMake 2.8-11.app/Contents/share/cmake-2.8
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_SKIP_RPATH
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_STRIP
CMAKE_STRIP-ADVANCED:INTERNAL=1
//uname command
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS
CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1

@jamesguo
Copy link
Author

jamesguo commented Aug 7, 2013

my cmke file :

set(CMAKE_SYSTEM_NAME Linux)
set(ANDROID_PLATFORM ON)
if(ANDROID_PLATFORM)
set(ANDROID_DEMO ON)
endif()
if(ANDROID_DEMO)
add_definitions(-DNE10_ANDROID_DEMO)
endif()
if(DEFINED ENV{ANDROID_NDK})
if(NOT DEFINED ENV{ANDROID_API_LEVEL})
set(ANDROID_API_LEVEL 14)
else()
set(ANDROID_API_LEVEL $ENV{ANDROID_API_LEVEL})
endif()
if(NOT DEFINED ENV{ARM_ANDROID_TOOLCHAIN_VERSION})
set(ARM_ANDROID_TOOLCHAIN_VERSION 4.6)
else()
set(ARM_ANDROID_TOOLCHAIN_VERSION $ENV{ARM_ANDROID_TOOLCHAIN_VERSION})
endif()
#NDK_SYSROOT_PATH is used in compiler's '--sysroot' flags
set(NDK_SYSROOT_PATH "$ENV{ANDROID_NDK}/platforms/android-${ANDROID_API_LEVEL}/arch-arm/")
set(ANDROID_TOOLCHAIN_PATH "$ENV{ANDROID_NDK}/toolchains/arm-linux-androideabi-${ARM_ANDROID_TOOLCHAIN_VERSION}/prebuilt/darwin-x86_64/bin")
#change toolchain name according to your configuration

set(CMAKE_C_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-gcc)

set(CMAKE_CXX_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-g++)

set(CMAKE_ASM_COMPILER ${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-as)

#Skip the platform compiler checks for cross compiling
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_ASM_COMPILER_WORKS TRUE)
find_program(CMAKE_AR NAMES "${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-ar")
mark_as_advanced(CMAKE_AR)
find_program(CMAKE_RANLIB NAMES "${ANDROID_TOOLCHAIN_PATH}/arm-linux-androideabi-ranlib")
mark_as_advanced(CMAKE_RANLIB)
else()
message(FATAL_ERROR "Could not find Android NDK. You should set an environment variable: export ANDROID_NDK=/your/path/to/android/ndk")
endif()

@zhongweiy
Copy link
Collaborator

Hi, James, a fix for Android building under Mac has been added, you can try it by following the step in doc/CMakeBuilding.txt

@jamesguo
Copy link
Author

jamesguo commented Sep 1, 2013

done,thanks a lot.

@jamesguo jamesguo closed this as completed Sep 1, 2013
@dhanvarsh03
Copy link

error: unknown target CPU 'armv7-a'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, x86-64
make: *** [gst-build-armeabi-v7a/gstreamer_android.o] Error 1

Can anyone please help me on this issue????

@edidada
Copy link

edidada commented Jul 3, 2020

error: unknown target CPU 'armv7-a'
note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, x86-64
make: *** [gst-build-armeabi-v7a/gstreamer_android.o] Error 1

Can anyone please help me on this issue????

I also meet this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants