«

安卓打包修改配置

时间:2024-3-2 18:21     作者:韩俊     分类: Android


环境:cocos2d-x-3.1.1 vs2013


主要修改有两个文件都是Android.mk

一个在

cocos2d-xcocosscriptinglua-bindingsAndroid.mk


例如:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE    := cocos_lua_static

LOCAL_MODULE_FILENAME := liblua

LOCAL_SRC_FILES := manual/CCLuaBridge.cpp 
          manual/CCLuaEngine.cpp 
          manual/CCLuaStack.cpp 
          manual/lua_debugger.c 
          manual/CCLuaValue.cpp 
          manual/Cocos2dxLuaLoader.cpp 
          manual/CCBProxy.cpp 
          manual/Lua_web_socket.cpp 
          manual/LuaOpengl.cpp 
          manual/LuaScriptHandlerMgr.cpp 
          manual/LuaBasicConversions.cpp 
          manual/LuaSkeletonAnimation.cpp 
          manual/lua_cocos2dx_manual.cpp 
          manual/lua_cocos2dx_extension_manual.cpp 
          manual/lua_cocos2dx_coco_studio_manual.cpp 
          manual/lua_cocos2dx_ui_manual.cpp 
          manual/lua_cocos2dx_spine_manual.cpp 
          manual/lua_cocos2dx_physics_manual.cpp 
          manual/lua_cocos2dx_deprecated.cpp 
          manual/lua_xml_http_request.cpp 
          manual/platform/android/CCLuaJavaBridge.cpp 
          manual/platform/android/jni/Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge.cpp 
          manual/tolua_fix.cpp 
          manual/lua_extensions.c 
          auto/lua_cocos2dx_auto.cpp 
          auto/lua_cocos2dx_extension_auto.cpp 
          auto/lua_cocos2dx_studio_auto.cpp 
          auto/lua_cocos2dx_ui_auto.cpp 
          auto/lua_cocos2dx_spine_auto.cpp 
          auto/lua_cocos2dx_physics_auto.cpp 
          ../../../external/lua/tolua/tolua_event.c 
          ../../../external/lua/tolua/tolua_is.c 
          ../../../external/lua/tolua/tolua_map.c 
          ../../../external/lua/tolua/tolua_push.c 
          ../../../external/lua/tolua/tolua_to.c 
          ../../../external/lua/luasocket/auxiliar.c 
          ../../../external/lua/luasocket/buffer.c 
          ../../../external/lua/luasocket/except.c 
          ../../../external/lua/luasocket/inet.c 
          ../../../external/lua/luasocket/io.c 
          ../../../external/lua/luasocket/luasocket.c 
          ../../../external/lua/luasocket/mime.c 
          ../../../external/lua/luasocket/options.c 
          ../../../external/lua/luasocket/select.c 
          ../../../external/lua/luasocket/serial.c 
          ../../../external/lua/luasocket/tcp.c 
          ../../../external/lua/luasocket/timeout.c 
          ../../../external/lua/luasocket/udp.c 
          ../../../external/lua/luasocket/unix.c 
          ../../../external/lua/luasocket/usocket.c 
          ../../../external/lua/cjson/fpconv.c 
          ../../../external/lua/cjson/lua_cjson.c 
          ../../../external/lua/cjson/strbuf.c 
          ../../../external/lua/md5/des56.c 
          ../../../external/lua/md5/ldes56.c 
          ../../../external/lua/md5/md5.c 
          ../../../external/lua/md5/md5lib.c 

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../external/lua/tolua 
                    $(LOCAL_PATH)/../../../external/lua/luajit/include 
                    $(LOCAL_PATH)/../../../external/lua 
                    $(LOCAL_PATH)/../../../extensions 
                    $(LOCAL_PATH)/../../editor-support/spine 
                    $(LOCAL_PATH)/../../editor-support/cocosbuilder 
                    $(LOCAL_PATH)/../../editor-support/cocostudio 
                    $(LOCAL_PATH)/../../ui 
                    $(LOCAL_PATH)/auto 
                    $(LOCAL_PATH)/manual 
                    $(LOCAL_PATH)/manual/platform/android 
                    $(LOCAL_PATH)/manual/platform/android/jni

LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../external/lua/tolua 
                           $(LOCAL_PATH)/../../../external/lua/luajit/include 
                           $(LOCAL_PATH)/../external 
                           $(LOCAL_PATH)/auto 
                           $(LOCAL_PATH)/manual

LOCAL_WHOLE_STATIC_LIBRARIES := luajit_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += websockets_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_network_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosbuilder_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocostudio_static
LOCAL_WHOLE_STATIC_LIBRARIES += spine_static

LOCAL_CFLAGS += -Wno-psabi
LOCAL_EXPORT_CFLAGS += -Wno-psabi

include $(BUILD_STATIC_LIBRARY)

$(call import-module,lua/luajit/prebuilt/android)
$(call import-module,extensions)
$(call import-module,.)
$(call import-module,websockets/prebuilt/android)
$(call import-module,network)
$(call import-module,editor-support/cocostudio)
$(call import-module,editor-support/cocosbuilder)
$(call import-module,editor-support/spine)




另一个在

frameworksruntime-srcproj.androidjniAndroid.mk


例如:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dlua_shared

LOCAL_MODULE_FILENAME := libcocos2dlua

FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)

LOCAL_SRC_FILES := hellolua/main.cpp 
                   $(FILE_LIST:$(LOCAL_PATH)/%=%)
                   #../../Classes/AppDelegate.cpp

LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes 
                    $(LOCAL_PATH)/../../../cocos2d-x/extensions 
                    $(LOCAL_PATH)/../../../cocos2d-x/external 
                    $(LOCAL_PATH)/../../../cocos2d-x/cocos/editor-support 
                    $(LOCAL_PATH)/../../../cocos2d-x/cocos/editor-support/cocostudio 
                    $(LOCAL_PATH)/../../../cocos2d-x/cocos/audio/include 
                    $(LOCAL_PATH)/../../../cocos2d-x/cocos/scripting/lua-bindings/auto 
                    $(LOCAL_PATH)/../../../cocos2d-x/cocos/scripting/lua-bindings/manual 
                    $(LOCAL_PATH)/../../../cocos2d-x/external/lua/lua 
                    $(LOCAL_PATH)/../../../cocos2d-x/external/lua/tolua 
                    $(LOCAL_PATH)/../../../cocos2d-x

LOCAL_STATIC_LIBRARIES := curl_static_prebuilt

LOCAL_WHOLE_STATIC_LIBRARIES := cocos_lua_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,scripting/lua-bindings)


frameworksruntime-srcproj.androidproject.properties

将target=android-10改成多少自己定,和ndk,sdk有关

标签: android

热门推荐