Only compile iOS files on iOS

This commit is contained in:
Ricardo Quesada 2014-01-27 16:44:10 -08:00
parent 1f4ca2f0ad
commit b96c4f1ad0
19 changed files with 96 additions and 6 deletions

View File

@ -1 +1 @@
99ea8c15ffe770eb2acd216155c34866bbd4a645 91c2f471146ed7285ab1d0f093185ffbbd06896c

View File

@ -26,6 +26,9 @@ THE SOFTWARE.
#ifndef __CC_APPLICATION_IOS_H__ #ifndef __CC_APPLICATION_IOS_H__
#define __CC_APPLICATION_IOS_H__ #define __CC_APPLICATION_IOS_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/CCCommon.h" #include "platform/CCCommon.h"
#include "platform/CCApplicationProtocol.h" #include "platform/CCApplicationProtocol.h"
@ -90,4 +93,6 @@ protected:
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS
#endif // end of __CC_APPLICATION_IOS_H__ #endif // end of __CC_APPLICATION_IOS_H__

View File

@ -25,6 +25,8 @@
#import "CCApplication.h" #import "CCApplication.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CCGeometry.h" #import "CCGeometry.h"
@ -152,3 +154,5 @@ void Application::applicationScreenSizeChanged(int newWidth, int newHeight) {
} }
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS

View File

@ -23,6 +23,9 @@
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "platform/CCCommon.h" #include "platform/CCCommon.h"
#include <stdarg.h> #include <stdarg.h>
@ -54,3 +57,5 @@ void LuaLog(const char * format)
} }
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS

View File

@ -22,6 +22,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCDevice.h" #include "CCDevice.h"
#include "ccTypes.h" #include "ccTypes.h"
#include "CCEventDispatcher.h" #include "CCEventDispatcher.h"
@ -174,3 +179,5 @@ void Device::setAccelerometerInterval(float interval)
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS

View File

@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
*/ */
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <OpenGLES/EAGL.h> #import <OpenGLES/EAGL.h>
#import <OpenGLES/EAGLDrawable.h> #import <OpenGLES/EAGLDrawable.h>
@ -155,3 +158,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
-(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis; -(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis;
-(void) doAnimationWhenAnotherEditBeClicked; -(void) doAnimationWhenAnotherEditBeClicked;
@end @end
#endif // CC_PLATFORM_IOS

View File

@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
*/ */
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import <QuartzCore/QuartzCore.h> #import <QuartzCore/QuartzCore.h>
#import "CCEGLView.h" #import "CCEGLView.h"
#import "CCEAGLView.h" #import "CCEAGLView.h"
@ -922,3 +925,5 @@ static CCEAGLView *__view = 0;
} }
@end @end
#endif // CC_PLATFORM_IOS

View File

@ -26,6 +26,9 @@
#ifndef __CC_EGLVIEW_IPHONE_H__ #ifndef __CC_EGLVIEW_IPHONE_H__
#define __CC_EGLVIEW_IPHONE_H__ #define __CC_EGLVIEW_IPHONE_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCObject.h" #include "CCObject.h"
#include "platform/CCCommon.h" #include "platform/CCCommon.h"
#include "platform/CCEGLViewProtocol.h" #include "platform/CCEGLViewProtocol.h"
@ -59,4 +62,6 @@ protected:
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS
#endif // end of __CC_EGLVIEW_IPHONE_H__ #endif // end of __CC_EGLVIEW_IPHONE_H__

View File

@ -22,6 +22,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCEAGLView.h" #include "CCEAGLView.h"
#include "CCDirectorCaller.h" #include "CCDirectorCaller.h"
#include "CCEGLView.h" #include "CCEGLView.h"
@ -125,6 +130,7 @@ void EGLView::setIMEKeyboardState(bool bOpen)
} }
} }
NS_CC_END NS_CC_END
#endif // CC_PLATFOR_IOS

View File

@ -27,6 +27,10 @@
// Only compile this code on iOS. These files should NOT be included on your Mac project. // Only compile this code on iOS. These files should NOT be included on your Mac project.
// But in case they are included, it won't be compiled. // But in case they are included, it won't be compiled.
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import "CCPlatformMacros.h" #import "CCPlatformMacros.h"
#import "CCESRenderer.h" #import "CCESRenderer.h"
#import <OpenGLES/ES2/gl.h> #import <OpenGLES/ES2/gl.h>
@ -76,4 +80,4 @@
@end @end
#endif // CC_PLATFORM_IOS

View File

@ -28,8 +28,11 @@
// Only compile this code on iOS. These files should NOT be included on your Mac project. // Only compile this code on iOS. These files should NOT be included on your Mac project.
// But in case they are included, it won't be compiled. // But in case they are included, it won't be compiled.
#import "CCPlatformMacros.h"
#import "CCES2Renderer.h" #import "CCES2Renderer.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import "CCPlatformMacros.h"
#import "OpenGL_Internal.h" #import "OpenGL_Internal.h"
#if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0
@ -251,3 +254,5 @@
@end @end
#endif // CC_PLATFORM_IOS

View File

@ -27,6 +27,10 @@
// Only compile this code on iOS. These files should NOT be included on your Mac project. // Only compile this code on iOS. These files should NOT be included on your Mac project.
// But in case they are included, it won't be compiled. // But in case they are included, it won't be compiled.
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCPlatformMacros.h" #include "CCPlatformMacros.h"
#import <QuartzCore/QuartzCore.h> #import <QuartzCore/QuartzCore.h>
@ -48,3 +52,4 @@
- (unsigned int) msaaColorBuffer; - (unsigned int) msaaColorBuffer;
@end @end
#endif // CC_PLATFORM_IOS

View File

@ -26,6 +26,9 @@ THE SOFTWARE.
#ifndef __PLATFORM_IOS_CCGL_H__ #ifndef __PLATFORM_IOS_CCGL_H__
#define __PLATFORM_IOS_CCGL_H__ #define __PLATFORM_IOS_CCGL_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#define glClearDepth glClearDepthf #define glClearDepth glClearDepthf
#define glDeleteVertexArrays glDeleteVertexArraysOES #define glDeleteVertexArrays glDeleteVertexArraysOES
#define glGenVertexArrays glGenVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES
@ -39,5 +42,7 @@ THE SOFTWARE.
#include <OpenGLES/ES2/gl.h> #include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h> #include <OpenGLES/ES2/glext.h>
#endif // CC_PLATFORM_IOS
#endif // __PLATFORM_IOS_CCGL_H__ #endif // __PLATFORM_IOS_CCGL_H__

View File

@ -22,6 +22,10 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCImageCommon_cpp.h" #include "CCImageCommon_cpp.h"
#import "CCImage.h" #import "CCImage.h"
@ -468,3 +472,5 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB)
NS_CC_END NS_CC_END
#endif // CC_PLATFORM_IOS

View File

@ -25,6 +25,9 @@ THE SOFTWARE.
#ifndef __CCPLATFORMDEFINE_H__ #ifndef __CCPLATFORMDEFINE_H__
#define __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include <assert.h> #include <assert.h>
#define CC_DLL #define CC_DLL
@ -44,5 +47,6 @@ THE SOFTWARE.
#endif #endif
#endif // CC_PLATFORM_IOS
#endif /* __CCPLATFORMDEFINE_H__*/ #endif /* __CCPLATFORMDEFINE_H__*/

View File

@ -26,6 +26,9 @@ THE SOFTWARE.
#ifndef __CC_STD_C_H__ #ifndef __CC_STD_C_H__
#define __CC_STD_C_H__ #define __CC_STD_C_H__
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#include "CCPlatformMacros.h" #include "CCPlatformMacros.h"
#include <float.h> #include <float.h>
#include <math.h> #include <math.h>
@ -45,4 +48,5 @@ THE SOFTWARE.
#define MAX(x,y) (((x) < (y)) ? (y) : (x)) #define MAX(x,y) (((x) < (y)) ? (y) : (x))
#endif // MAX #endif // MAX
#endif // CC_PLATFORM_IOS
#endif // __CC_STD_C_H__ #endif // __CC_STD_C_H__

View File

@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
*/ */
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
/* Generic error reporting */ /* Generic error reporting */
#define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String]) #define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String])
@ -79,3 +82,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
#endif #endif
#define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__)) #define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__))
#define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); } #define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); }
#endif // CC_PLATFORM_IOS

View File

@ -23,6 +23,10 @@ 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 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
****************************************************************************/ ****************************************************************************/
#include "CCPlatformConfig.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
#import <TargetConditionals.h> #import <TargetConditionals.h>
// when compiling to ARM (iPhone device), hide everything and use system defaults // when compiling to ARM (iPhone device), hide everything and use system defaults
@ -73,4 +77,6 @@ THE SOFTWARE.
@end @end
#endif #endif // !TARGET_CPU_ARM
#endif // CC_PLATFORM_IOS

View File

@ -26,6 +26,8 @@ THE SOFTWARE.
#import "AccelerometerSimulation.h" #import "AccelerometerSimulation.h"
#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS
// when compiling to ARM (iPhone device), hide everything and use system defaults // when compiling to ARM (iPhone device), hide everything and use system defaults
// if you wish to use simulation mode even on the device, remove the #if/#endif // if you wish to use simulation mode even on the device, remove the #if/#endif
#if !TARGET_CPU_ARM #if !TARGET_CPU_ARM
@ -263,4 +265,6 @@ static CCAccelerometerSimulation *sharedAccelerometer = NULL;
} }
@end @end
#endif #endif // !TARGET_CPU_ARM
#endif // CC_PLATFORM_IOS