[NaCl] Fix NaCl build which had been disabled.

Since switching to C++11 the NaCL build was disabled.
This re-enables the ARM configuration which uses a
more recent version of gcc.  This means that that NaCl
code paths will at least be test until we can find a way
to re-enable the X86 build.
This commit is contained in:
Sam Clegg 2013-06-20 12:15:42 -07:00
parent ab1243e8dd
commit 40766006bd
10 changed files with 49 additions and 9 deletions

View File

@ -4,8 +4,9 @@ env:
matrix:
- GEN_JSB=YES
- PLATFORM=linux DEBUG=1
# Native client port doesn't support c++ 11 fully, it seems that it doesn't support lambda, please refer to https://github.com/cocos2d/cocos2d-x/blob/develop/samples/Cpp/TestCpp/Classes/ActionsTest/ActionsTest.cpp#L982
# - PLATFORM=nacl DEBUG=1
# Since switching to C++11 only the ARM version of the nactive client
# port currently builds. TODO(sbc): Re-enable all architectures.
- PLATFORM=nacl DEBUG=1 NACL_ARCH=arm
- PLATFORM=android
- PLATFORM=emscripten DEBUG=1
global:
@ -24,6 +25,7 @@ env:
script:
- export NACL_SDK_ROOT=$HOME/bin/nacl_sdk/pepper_canary
- export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin
- export PATH=$PATH:$NACL_SDK_ROOT/toolchain/linux_arm_newlib/bin
- export NDK_ROOT=$HOME/bin/android-ndk
- export PYTHON=/usr/bin/python
- export LLVM=$HOME/bin/clang+llvm-3.2/bin

View File

@ -40,7 +40,7 @@ public:
void removeDelegate(std::function<void(Acceleration*)> function) {CC_UNUSED_PARAM(function);};
void addDelegate(std::function<void(Acceleration*)> function) {CC_UNUSED_PARAM(function);};
void setDelegate(AccelerometerDelegate* pDelegate) {CC_UNUSED_PARAM(pDelegate);};
void setDelegate(std::function<void(Acceleration*)> function) {CC_UNUSED_PARAM(function);};
void setAccelerometerInterval(float interval) {CC_UNUSED_PARAM(interval);};
};

View File

@ -9,11 +9,11 @@ NACL_ARCH ?= x86_64
NACL_AR ?= $(NACL_ARCH)-nacl-ar
NACL_CC ?= $(NACL_ARCH)-nacl-gcc
NACL_CXX ?= $(NACL_ARCH)-nacl-g++
CCFLAGS += -Wall -Werror
CCFLAGS += -Wall -Werror -Wno-deprecated-declarations
# GCC 4.6 is primary platform for cocos2d v.3, because it's default compiler for Android,
# Blackberry, some Linux distributions.It supports all important features of c++11, but have
# no flag "-std=c++11" (which was turned on in version 4.7).
CXXFLAGS += -Wall -Werror -std=gnu++0x
CXXFLAGS += -Wall -Werror -Wno-deprecated-declarations -std=gnu++0x
ARFLAGS = cr
THIS_MAKEFILE := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))

View File

@ -59,9 +59,38 @@ EXTENSIONS_SOURCES = ../CCBReader/CCBFileLoader.cpp \
../spine/Slot.cpp \
../spine/SlotData.cpp \
../spine/extension.cpp \
../spine/spine-cocos2dx.cpp \
../spine/CCSkeleton.cpp \
../spine/CCSkeletonAnimation.cpp \
../spine/spine-cocos2dx.cpp
../CCArmature/CCArmature.cpp \
../CCArmature/CCBone.cpp \
../CCArmature/animation/CCArmatureAnimation.cpp \
../CCArmature/animation/CCProcessBase.cpp \
../CCArmature/animation/CCTween.cpp \
../CCArmature/datas/CCDatas.cpp \
../CCArmature/display/CCBatchNode.cpp \
../CCArmature/display/CCDecorativeDisplay.cpp \
../CCArmature/display/CCDisplayFactory.cpp \
../CCArmature/display/CCDisplayManager.cpp \
../CCArmature/display/CCShaderNode.cpp \
../CCArmature/display/CCSkin.cpp \
../CCArmature/external_tool/GLES-Render.cpp \
../CCArmature/external_tool/Json/CSContentJsonDictionary.cpp \
../CCArmature/external_tool/Json/lib_json/json_value.cpp \
../CCArmature/external_tool/Json/lib_json/json_reader.cpp \
../CCArmature/external_tool/Json/lib_json/json_writer.cpp \
../CCArmature/physics/CCColliderDetector.cpp \
../CCArmature/physics/CCPhysicsWorld.cpp \
../CCArmature/utils/CCArmatureDataManager.cpp \
../CCArmature/utils/CCDataReaderHelper.cpp \
../CCArmature/utils/CCSpriteFrameCacheHelper.cpp \
../CCArmature/utils/CCTransformHelp.cpp \
../CCArmature/utils/CCTweenFunction.cpp \
../CCArmature/utils/CCUtilMath.cpp \
../Components/CCComAttribute.cpp \
../Components/CCComAudio.cpp \
../Components/CCComController.cpp \
../Components/CCInputDelegate.cpp
all:

View File

@ -51,6 +51,9 @@ CurrentLanguageTest::CurrentLanguageTest()
case kLanguageNorwegian:
labelLanguage->setString("current language is Norwegian");
break;
case kLanguagePolish:
labelLanguage->setString("current language is Polish");
break;
}
addChild(labelLanguage);

View File

@ -3,7 +3,7 @@
#include "NotificationCenterTest/NotificationCenterTest.h"
#include "ControlExtensionTest/CCControlSceneManager.h"
#include "CocosBuilderTest/CocosBuilderTest.h"
#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) && CC_TARGET_PLATFORM != CC_PLATFORM_NACL)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) && (CC_TARGET_PLATFORM != CC_PLATFORM_NACL)
#include "NetworkTest/HttpClientTest.h"
#endif
#include "TableViewTest/TableViewTestScene.h"
@ -43,7 +43,7 @@ static struct {
pScene->release();
}
}},
#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) && CC_TARGET_PLATFORM != CC_PLATFORM_NACL)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN) && (CC_TARGET_PLATFORM != CC_PLATFORM_NACL)
{ "HttpClientTest", [](Object *sender){ runHttpClientTest();}
},
#endif

View File

@ -33,11 +33,13 @@ struct {
{ "CocosDenshionTest", []() { return new CocosDenshionTestScene(); } },
{ "ConfigurationTest", []() { return new ConfigurationTestScene(); } },
#if (CC_TARGET_PLATFORM != CC_PLATFORM_EMSCRIPTEN)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_NACL)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
#if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA)
{ "CurlTest", []() { return new CurlTestScene(); } },
#endif
#endif
#endif
#endif
{ "CurrentLanguageTest", []() { return new CurrentLanguageTestScene(); } },
{ "DrawPrimitivesTest", [](){return new DrawPrimitivesTestScene();} },

View File

@ -17,6 +17,7 @@ SOURCES = main.cpp \
../Classes/AppDelegate.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaValue.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c \

View File

@ -17,6 +17,7 @@ SOURCES = main.cpp \
../Classes/AppDelegate.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaEngine.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaStack.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/CCLuaValue.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/Cocos2dxLuaLoader.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/LuaCocos2d.cpp \
$(COCOS_ROOT)/scripting/lua/cocos2dx_support/tolua_fix.c \

View File

@ -71,8 +71,10 @@ if [ "$PLATFORM"x = "linux"x ]; then
fi
if [ "$PLATFORM"x = "nacl"x ]; then
# NaCl compilers are built for 32-bit linux so we need to install
# the runtime support for this.
sudo apt-get update
sudo apt-get install libc6:i386
sudo apt-get install libc6:i386 libstdc++6:i386
echo "Download nacl_sdk ..."
wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip
echo "Decompress nacl_sdk.zip"