2011-03-07 17:11:57 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010 cocos2d-x.org
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-03-26 14:09:42 +08:00
|
|
|
#ifndef __CC_PLATFORM_CONFIG_H__
|
|
|
|
#define __CC_PLATFORM_CONFIG_H__
|
2011-03-07 17:11:57 +08:00
|
|
|
|
|
|
|
/**
|
2011-08-08 23:05:47 +08:00
|
|
|
Config of cocos2d-x project.
|
2011-03-07 17:11:57 +08:00
|
|
|
|
|
|
|
There are config below:
|
2011-08-08 23:05:47 +08:00
|
|
|
build for which target platform
|
2011-03-07 17:11:57 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// pre configure
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2011-03-09 14:40:05 +08:00
|
|
|
// define supported target platform macro which CC uses.
|
2011-03-07 17:11:57 +08:00
|
|
|
#define CC_PLATFORM_UNKNOWN 0
|
|
|
|
#define CC_PLATFORM_IOS 1
|
2011-04-11 11:24:10 +08:00
|
|
|
#define CC_PLATFORM_ANDROID 2
|
|
|
|
#define CC_PLATFORM_WOPHONE 3
|
|
|
|
#define CC_PLATFORM_WIN32 4
|
|
|
|
#define CC_PLATFORM_AIRPLAY 5
|
2011-03-07 17:11:57 +08:00
|
|
|
|
|
|
|
// Determine tartet platform by compile environment macro.
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
|
|
|
|
|
|
|
|
// iphone
|
|
|
|
#if ! CC_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_IOS
|
|
|
|
#define CC_SUPPORT_MULTITHREAD 0
|
|
|
|
#define CC_SUPPORT_UNICODE 0
|
2011-07-19 15:14:59 +08:00
|
|
|
#define CC_SUPPORT_PVRTC
|
2011-03-07 17:11:57 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// android
|
|
|
|
#if ! CC_TARGET_PLATFORM && defined(ANDROID)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID
|
|
|
|
#endif
|
|
|
|
|
2011-03-09 17:28:35 +08:00
|
|
|
// wophone
|
2011-03-07 17:11:57 +08:00
|
|
|
#if ! CC_TARGET_PLATFORM && defined(_TRANZDA_VM_)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
2011-03-09 17:28:35 +08:00
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_WOPHONE
|
2011-03-07 17:11:57 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// win32
|
|
|
|
#if ! CC_TARGET_PLATFORM && (defined(WIN32) && defined(_WINDOWS))
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_WIN32
|
|
|
|
|
|
|
|
#define CC_SUPPORT_MULTITHREAD 1
|
|
|
|
#if defined(UNICODE)
|
|
|
|
#define CC_SUPPORT_UNICODE 1
|
|
|
|
#else
|
|
|
|
#define CC_SUPPORT_UNICODE 0
|
|
|
|
#endif
|
|
|
|
#endif
|
2011-03-23 22:16:20 +08:00
|
|
|
// airplay
|
|
|
|
#if ! CC_TARGET_PLATFORM && defined(AIRPLAY)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_AIRPLAY
|
|
|
|
#endif
|
2011-03-07 17:11:57 +08:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// user configure
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Check user assigned target platform.
|
|
|
|
#if defined(CC_UNDER_IOS)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_IOS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(CC_UNDER_ANDROID)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID
|
|
|
|
#endif
|
|
|
|
|
2011-03-09 17:28:35 +08:00
|
|
|
#if defined(CC_UNDER_WOPHONE)
|
2011-03-07 17:11:57 +08:00
|
|
|
#undef CC_TARGET_PLATFORM
|
2011-03-09 17:28:35 +08:00
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_WOPHONE
|
2011-03-07 17:11:57 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(CC_UNDER_WIN32)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_WIN32
|
|
|
|
#endif
|
|
|
|
|
2011-03-23 22:16:20 +08:00
|
|
|
#if defined(CC_UNDER_AIRPLAY)
|
|
|
|
#undef CC_TARGET_PLATFORM
|
|
|
|
#define CC_TARGET_PLATFORM CC_PLATFORM_AIRPLAY
|
|
|
|
#endif
|
2011-03-07 17:11:57 +08:00
|
|
|
// Check user assigned supportive of multi-thread
|
|
|
|
#if defined(CC_ENABLE_MULTITHREAD)
|
|
|
|
#undef CC_SUPPORT_MULTITHREAD
|
|
|
|
#define CC_SUPPORT_MULTITHREAD 1
|
|
|
|
#elif defined(CC_DISABLE_MULTITHREAD)
|
|
|
|
#undef CC_SUPPORT_MULTITHREAD
|
|
|
|
#define CC_SUPPORT_MULTITHREAD 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Check user assigned supportive of unicode
|
|
|
|
#if defined(CC_ENABLE_UNICODE)
|
|
|
|
#undef CC_SUPPORT_UNICODE
|
|
|
|
#define CC_SUPPORT_UNICODE 1
|
|
|
|
#elif defined(CC_DISABLE_UNICODE)
|
|
|
|
#undef CC_SUPPORT_UNICODE
|
|
|
|
#define CC_SUPPORT_UNICODE 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// post configure
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// check user set platform
|
|
|
|
#if ! CC_TARGET_PLATFORM
|
|
|
|
#error "Can not recognize the target platform, compling under a unsupported platform?"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// cocos2d-x havn't support multi-thread yet
|
|
|
|
#undef CC_SUPPORT_MULTITHREAD
|
|
|
|
#define CC_SUPPORT_MULTITHREAD 0
|
|
|
|
|
|
|
|
// cocos2d-x havn't support unicode yet
|
|
|
|
#undef CC_SUPPORT_UNICODE
|
|
|
|
#define CC_SUPPORT_UNICODE 0
|
|
|
|
|
|
|
|
// Check the supportive of platform
|
|
|
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
2011-06-10 17:51:37 +08:00
|
|
|
#pragma warning (disable:4127)
|
2011-03-07 17:11:57 +08:00
|
|
|
#endif // CC_PLATFORM_WIN32
|
2011-03-26 14:09:42 +08:00
|
|
|
|
|
|
|
#endif // __CC_PLATFORM_CONFIG_H__
|
2011-03-07 17:11:57 +08:00
|
|
|
|