From 524b6903a5c7e8064cba2edd6beb47aaaea2c0b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Tue, 30 Jul 2013 14:49:44 +0200 Subject: [PATCH] Added clang support for linux. --- cocos2dx/proj.linux/cocos2dx.mk | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/cocos2dx/proj.linux/cocos2dx.mk b/cocos2dx/proj.linux/cocos2dx.mk index bb1b98d495..ce2b2430c9 100644 --- a/cocos2dx/proj.linux/cocos2dx.mk +++ b/cocos2dx/proj.linux/cocos2dx.mk @@ -1,14 +1,36 @@ +################################################################################ +# +# LINUX MAKEFILE +# +# Available options are: +# - CLANG=1 : Compiles with clang instead of gcc. Clang must be in your PATH. +# - V=1 : Enables the verbose mode. +# - DEBUG=1 : Enables the debug mode, disable compiler optimizations. +# - OPENAL=1 : Uses OpenAL instead of FMOD as sound engine. +# +################################################################################ + all: -CC = gcc -CXX = g++ # Remove -Wall, because it enables -Wunused-function, and this warning exists in webp.h # when enable c++11. I don't know why. # 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). -CCFLAGS += -MMD -Werror -Wno-deprecated-declarations -fPIC -CXXFLAGS += -MMD -Werror -Wno-deprecated-declarations -fPIC -std=gnu++0x +CCFLAGS += -MMD -Wno-deprecated-declarations -fPIC +CXXFLAGS += -MMD -Wno-deprecated-declarations -fPIC -std=gnu++0x + +ifeq ($(CLANG), 1) +CC := clang +CXX := clang++ +DEFINES += -D__STRICT_ANSI__ # Allows clang 3.3 to use __float128 +else +CC = gcc +CXX = g++ +CCFLAGS += -Werror +CXXFLAGS += -Werror +endif + ARFLAGS = cr DEFINES += -DLINUX -DCC_KEYBOARD_SUPPORT