some tweaks to the build process, cmake now generates some vital files, fpc only compiles those files which have been changed since the last time, SDL still does not work
--- a/.hgignore Sun Jan 22 23:35:32 2012 +0100
+++ b/.hgignore Sun Jan 22 23:36:36 2012 +0100
@@ -44,9 +44,9 @@
glob:project_files/Android-build/SDL-android-project/bin
glob:project_files/Android-build/SDL-android-project/gen
glob:project_files/Android-build/SDL-android-project/local.properties
+glob:project_files/Android-build/SDL-android-project/project.properties
glob:project_files/Android-build/SDL-android-project/default.properties
+glob:project_files/Android-build/SDL-android-project/proguard.cfg
glob:project_files/Android-build/SDL-android-project/.*
-glob:project_files/Android-build/complete_build.sh
-glob:project_files/Android-build/pushToDevice.sh
+glob:project_files/Android-build/out
glob:project_files/Android-build/Makefile.android
-glob:project_files/Android-build/out
--- a/project_files/Android-build/CMakeLists.txt Sun Jan 22 23:35:32 2012 +0100
+++ b/project_files/Android-build/CMakeLists.txt Sun Jan 22 23:36:36 2012 +0100
@@ -55,16 +55,22 @@
set(SDL_DIR /home/richard/Downloads/android-project)
-set(ANDROID_SDK_API_LVL 8)
+set(ANDROID_SDK_API_LVL 14)
set(ANDROID_NDK_API_LVL 5)
-MESSAGE(STATUS "Creating android scripts and configuration files")
+MESSAGE(STATUS "Creating Makefile.android...")
+
+configure_file(Templates/Makefile.android .)
-configure_file(Templates/complete_build.sh .)
-configure_file(Templates/default.properties SDL-android-project/)
-configure_file(Templates/local.properties SDL-android-project/)
-configure_file(Templates/Makefile.android .)
-configure_file(Templates/pushToDevice.sh .)
+find_program(ANDROID android "${ANDROID_SDK}" "${ANDROID_SDK}/tools")
+if(ANDROID)
+ exec_program(${ANDROID}
+ ARGS "update project"
+ "--path ${CMAKE_CURRENT_SOURCE_DIR}/SDL-android-project"
+ "--target android-${ANDROID_SDK_API_LVL}"
+ OUTPUT_VARIABLE dontcare
+ )
+endif(ANDROID)
if(SDL_DIR_TEMP_DISABLE)
MESSAGE("Moving Android port of SDL to the proper directories")
--- a/project_files/Android-build/SDL-android-project/project.properties Sun Jan 22 23:35:32 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-# Project target.
-target=android-4
--- a/project_files/Android-build/Templates/Makefile.android Sun Jan 22 23:35:32 2012 +0100
+++ b/project_files/Android-build/Templates/Makefile.android Sun Jan 22 23:36:36 2012 +0100
@@ -1,7 +1,7 @@
SDL_ANDROID_DIR=./SDL-android-project
PPCROSSARM=${FPC_DIR}/compiler/ppcrossarm
-PPCROSSARM_FLAGS= -Xd -O- -Tlinux -XParm-linux-androideabi- -vwnh -XS -a- -B
+PPCROSSARM_FLAGS= -Xd -O- -Tlinux -XParm-linux-androideabi- -vwnh
PPCROSSARM_INCLUDES= \
-FD${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin \
-Fu${FPC_DIR}/rtl/units/arm-linux \
@@ -20,7 +20,7 @@
$(PPCROSSARM) $(LINKERFLAGS) $(PPCROSSARM_FLAGS) $(PPCROSSARM_INCLUDES) $(FPC_DEFINES) -oout/libhwengine.so ../../hedgewars/hwLibrary.pas
${CMAKE_COMMAND} -E copy out/libhwengine.so SDL-android-project/libs/armeabi/
- ${ANT} install -f $(SDL_ANDROID_DIR)/build.xml
+ ${ANT} debug install -f $(SDL_ANDROID_DIR)/build.xml
clean:
${CMAKE_COMMAND} -E remove_directory out
${ANDROID_NDK}/ndk-build -C $(SDL_ANDROID_DIR) -j 8 clean
--- a/project_files/Android-build/Templates/complete_build.sh Sun Jan 22 23:35:32 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-
-cd SDL-android-project
-${ANDROID_NDK}/ndk-build -j 8
-if [ $? -ne 0 ]
-then
- echo "Failed to execute ${ANDROID_NDK}/ndk-build"
- exit 1
-fi
-
-cd ..
-make -f Makefile.android
-if [ $? -ne 0 ]
-then
- echo "Failed to execute make"
- exit 1
-fi
-
-cd SDL-android-project
-ant install
-if [ $? -ne 0 ]
-then
- echo "Failed to execute ant install"
- exit 1
-fi
-exit 0
--- a/project_files/Android-build/Templates/default.properties Sun Jan 22 23:35:32 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-target=android-${ANDROID_SDK_API_LVL}
--- a/project_files/Android-build/Templates/local.properties Sun Jan 22 23:35:32 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-sdk.dir=${ANDROID_SDK}
--- a/project_files/Android-build/Templates/pushToDevice.sh Sun Jan 22 23:35:32 2012 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-${ANDROID_SDK}/platform-tools/adb push ./out/libhwengine.so /sdcard/libhwengine.so
-${ANDROID_SDK}/platform-tools/adb shell "su -c \"cat /sdcard/libhwengine.so > /data/data/org.hedgewars.mobile/lib/libhwengine.so \""
-