From f3ff7955a8fc94a9033efd4b89f056e6c25fa57d Mon Sep 17 00:00:00 2001 From: samuelhu Date: Fri, 1 Nov 2013 11:18:02 +0800 Subject: [PATCH] issue #3037:Modify platform build config --- .../project.pbxproj.REMOVED.git-id | 2 +- samples/Lua/TestLua/Classes/AppDelegate.cpp | 2 +- .../luaScript/AssetsManagerTest/AssetsManagerTest.lua | 7 ++++--- samples/Lua/TestLua/proj.android/jni/Android.mk | 9 +++++---- samples/Lua/TestLua/proj.linux/Makefile | 7 +++++-- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id index da0402247e..56fa5cef1e 100644 --- a/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_samples.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -8d8d7ea290e8626153fe3dd955b85757a7bb6e05 \ No newline at end of file +ec80e8e2bcdb07b161a4ba7fcdee13bfec8cf347 \ No newline at end of file diff --git a/samples/Lua/TestLua/Classes/AppDelegate.cpp b/samples/Lua/TestLua/Classes/AppDelegate.cpp index 025f938b6b..deefa14f40 100644 --- a/samples/Lua/TestLua/Classes/AppDelegate.cpp +++ b/samples/Lua/TestLua/Classes/AppDelegate.cpp @@ -51,7 +51,7 @@ bool AppDelegate::applicationDidFinishLaunching() LuaEngine* pEngine = LuaEngine::getInstance(); ScriptEngineManager::getInstance()->setScriptEngine(pEngine); -#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID ||CC_TARGET_PLATFORM == CC_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32 || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID ||CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC) LuaStack* stack = pEngine->getLuaStack(); register_assetsmanager_test_sample(stack->getLuaState()); #endif diff --git a/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua b/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua index 853342a706..67be1499eb 100644 --- a/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua +++ b/samples/Lua/TestLua/Resources/luaScript/AssetsManagerTest/AssetsManagerTest.lua @@ -12,23 +12,24 @@ local menuItemNames = local winSize = cc.Director:getInstance():getWinSize() local function updateLayer() + local layer = cc.Layer:create() local support = false if (cc.PLATFORM_OS_IPHONE == targetPlatform) or (cc.PLATFORM_OS_IPAD == targetPlatform) or (cc.PLATFORM_OS_WINDOWS == targetPlatform) or (cc.PLATFORM_OS_ANDROID == targetPlatform) - or (cc.PLATFORM_OS_IPHONE == targetPlatform) then + or (cc.PLATFORM_OS_MAC == targetPlatform) then support = true end if not support then - return nil + print("Platform is not supported!") + return layer end local isUpdateItemClicked = false local assetsManager = nil local pathToSave = "" - local layer = cc.Layer:create() local menu = cc.Menu:create() menu:setPosition(cc.p(0, 0)) cc.MenuItemFont:setFontName("Arial") diff --git a/samples/Lua/TestLua/proj.android/jni/Android.mk b/samples/Lua/TestLua/proj.android/jni/Android.mk index 5dc5404354..4bc4ceafb3 100644 --- a/samples/Lua/TestLua/proj.android/jni/Android.mk +++ b/samples/Lua/TestLua/proj.android/jni/Android.mk @@ -6,14 +6,15 @@ LOCAL_MODULE := testlua_shared LOCAL_MODULE_FILENAME := libtestlua -LOCAL_SRC_FILES := testlua/main.cpp \ +LOCAL_SRC_FILES += testlua/main.cpp \ ../../Classes/AppDelegate.cpp \ ../../Classes/lua_assetsmanager_test_sample.cpp -LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \ - $(LOCAL_PATH)/../../../../external/lua/tolua \ - $(LOCAL_PATH)/../../../../cocos/scripting/lua/bindings +LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Classes \ + $(LOCAL_PATH)/../../../../../external/lua/tolua \ + $(LOCAL_PATH)/../../../../../extensions \ + $(LOCAL_PATH)/../../../../../cocos/scripting/lua/bindings LOCAL_STATIC_LIBRARIES := curl_static_prebuilt diff --git a/samples/Lua/TestLua/proj.linux/Makefile b/samples/Lua/TestLua/proj.linux/Makefile index 5151716394..8e9246c6ee 100644 --- a/samples/Lua/TestLua/proj.linux/Makefile +++ b/samples/Lua/TestLua/proj.linux/Makefile @@ -4,10 +4,13 @@ COCOS_ROOT = ../../../.. INCLUDES = -I../Classes \ -I$(COCOS_ROOT)/audio/include \ -I$(COCOS_ROOT)/cocos/scripting/lua/bindings \ - -I$(COCOS_ROOT)/external/lua/lua + -I$(COCOS_ROOT)/external/lua/lua \ + -I$(COCOS_ROOT)/external/lua/tolua \ + -I$(COCOS_ROOT)/extensions SOURCES = main.cpp \ -../Classes/AppDelegate.cpp +../Classes/AppDelegate.cpp \ +../Classes/lua_assetsmanager_test_sample.cpp SHAREDLIBS += -lcocos2d -lcocosdenshion -llua