Thanks for your hints. Following your snipped introductions I could solve
this issue and build my
static library. But now any PREBUILD is ignored.
I've generated dynamically to my source Android.mk file:
LOCAL_PATH := $(call my-dir)
LOCAL_CFLAGS += -DDEBUG
LOCAL_CFLAGS += -DANDROID
include $(CLEAR_VARS)
LOCAL_MODULE := jsoncpp
LOCAL_SRC_FILES := ../external-deps/jsoncpp/libjsoncpp.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../jsoncpp/include
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := brCore
# this is required while prebuild is ignored.
LOCAL_C_INCLUDES = $(LOCAL_PATH)/../include
LOCAL_SRC_FILES := brConfig.cpp \
brConfigSet.cpp \
brConfigManager.cpp \
brExceptionHandler.cpp \
brFileHandler.cpp \
brFileStream.cpp \
brHalfFloat.cpp \
brLibrary.cpp \
brLog.cpp \
brNode.cpp \
brRessourceManager.cpp \
brStringUtils.cpp \
brTimer.cpp \
exceptions/brException.cpp \
stacktrace/brLinuxStackTrace.cpp \
stacktrace/brStackTrace.cpp
LOCAL_STATIC_LIBRARIES := jsoncpp
LOCAL_STATIC_LIBRARIES += android_native_app_glue
include $(BUILD_SHARED_LIBRARY)
$(call import-module, android/native_app_glue)
This make file is invoked sucessfully from my root Android.mk file. The
code compiles
successfully, but the Prebuild is not performed:
Android NDK: Using build script
D:/binrev/repository/binrevengine-mgw/modules/
brCore/trunk/Android.mk
Android NDK: Application 'local' is not debuggable
Android NDK: Selecting optimization mode through Application.mk: debug
Android NDK: Adding import directory: /d/development/android/ndk-r8e/sources
Android NDK: Building application 'local' for ABI 'armeabi-v7a'
Android NDK: Using target toolchain 'arm-linux-androideabi-4.7' for
'armeabi-v7a
' ABI (through NDK_TOOLCHAIN_VERSION)
Android NDK: Looking for imported module with tag 'cxx-stl/gnu-libstdc++'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-libstd
c++/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/cxx-stl/gnu-lib
stdc++
Android NDK: Looking for imported module with tag 'android/native_app_glue'
Android NDK: Probing
/d/development/android/ndk-r8e/sources/android/native_app
_glue/Android.mk
Android NDK: Found in
/d/development/android/ndk-r8e/sources/android/native_
app_glue
Android NDK: Module 'brCore' has C++ sources
Android NDK: Add dependency 'gnustl_static' to module 'brCore'
Android NDK: Cygwin dependency file conversion script:
----- start of script ----
#!/bin/sh # AUTO-GENERATED FILE, DO NOT EDIT! if [ -f $1.org ]; then sed
-e 's
!^C:/Users/dl10hcn/AppData/Local/Temp!/tmp!ig;s!
C:/Users/dl10hcn/AppData/Local/
Temp! /tmp!ig;s!^d:/binrev/development/msys/mingw64!/mingw64!ig;s!
d:/binrev/dev
elopment/msys/mingw64! /mingw64!ig;s!^D:/binrev/development/msys!/usr!ig;s!
D:/b
inrev/development/msys! /usr!ig;s!^D:/binrev/development/msys/!/!ig;s!
D:/binrev
/development/msys/! /!ig;s!^y:!/y!ig;s! y:! /y!ig;s!^x:!/x!ig;s! x:!
/x!ig;s!^r:
!/r!ig;s! r:! /r!ig;s!^e:!/e!ig;s! e:! /e!ig;s!^d:!/d!ig;s! d:!
/d!ig;s!^c:!/c!i
g;s! c:! /c!ig;' $1.org > $1 && rm -f $1.org fi
------ end of script -----
Compile++ thumb : brCore <= brConfig.cpp
Compile++ thumb : brCore <= brConfigSet.cpp
Compile++ thumb : brCore <= brConfigManager.cpp
Compile++ thumb : brCore <= brExceptionHandler.cpp
Compile++ thumb : brCore <= brFileHandler.cpp
Compile++ thumb : brCore <= brFileStream.cpp
Compile++ thumb : brCore <= brHalfFloat.cpp
Compile++ thumb : brCore <= brLibrary.cpp
Compile++ thumb : brCore <= brLog.cpp
Compile++ thumb : brCore <= brNode.cpp
Compile++ thumb : brCore <= brRessourceManager.cpp
Compile++ thumb : brCore <= brStringUtils.cpp
Compile++ thumb : brCore <= brTimer.cpp
Compile++ thumb : brCore <= brException.cpp
Compile++ thumb : brCore <= brLinuxStackTrace.cpp
Compile++ thumb : brCore <= brStackTrace.cpp
SharedLibrary : libbrCore.so
Install : libbrCore.so =>
D:/binrev/repository/binrevengine-mgw/modules/b
rCore/trunk/libs/armeabi-v7a/libbrCore.so
[100%] Built target ndk
Any idea why my prebuild is ignored?
Actually I try to set up a CMake based NDK build for my application. I use
the CMake CONFIGURE_FILE command to create the required Android.mk,
SET(J "4" CACHE STRING "how many processes for make -j <J>")
ADD_CUSTOM_COMMAND(
OUTPUT Android-BinRev
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
COMMAND "${ANDROID_NDK}/ndk-build"
ARGS --directory=${CMAKE_BINARY_DIR}
NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
)
This works fine, but I got trouble to force the ndk-build to use a
different source folder instead of jni folder. The created object file
make.exe[3]: *** No rule to make target `jni/json_reader.cpp', needed by
`obj/lo
cal/armeabi/objs/jsoncpp/json_reader.o'. Stop.
I also tried to split the make, by using a separated Android.mk file at my
#ANDROID ROOT MAKEFILE
#=====================
LOCAL_PATH :=
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp
MY_LOCAL_CFLAGS := -DDEBUG
TARGET_PLATFORM := 'android-8'
LOCAL_ARM_MODE := arm
LOCAL_MODULE := jsoncpp
include
D:/binrev/repository/binrevengine-mgw/data/external-deps/jsoncpp/src/lib_json/Android.mk
include $(BUILD_STATIC_LIBRARY) # First lib, which will be built
statically.
#ANDROID SRC MAKEFILE
#====================
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := json_reader.cpp json_value.cpp json_writer.cpp
But this results in same failure. How could I solve this issue?
Thanks for any help.
--
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 http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.