blob: 2232acb44e15af1e608dae22f180e8563afda681 [file] [log] [blame]
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
}
import("../third_party.gni")
third_party("libsdl") {
public_include_dirs = [ "../externals/sdl/include" ]
include_dirs = [ "." ]
sources = [
"../externals/sdl/src/SDL.c",
"../externals/sdl/src/SDL_assert.c",
"../externals/sdl/src/SDL_error.c",
"../externals/sdl/src/SDL_hints.c",
"../externals/sdl/src/SDL_log.c",
"../externals/sdl/src/atomic/SDL_atomic.c",
"../externals/sdl/src/atomic/SDL_spinlock.c",
"../externals/sdl/src/audio/SDL_audio.c",
"../externals/sdl/src/audio/SDL_audiocvt.c",
"../externals/sdl/src/audio/SDL_audiodev.c",
"../externals/sdl/src/audio/SDL_audiotypecvt.c",
"../externals/sdl/src/audio/SDL_mixer.c",
"../externals/sdl/src/audio/SDL_wave.c",
"../externals/sdl/src/cpuinfo/SDL_cpuinfo.c",
"../externals/sdl/src/dynapi/SDL_dynapi.c",
"../externals/sdl/src/events/SDL_clipboardevents.c",
"../externals/sdl/src/events/SDL_dropevents.c",
"../externals/sdl/src/events/SDL_events.c",
"../externals/sdl/src/events/SDL_gesture.c",
"../externals/sdl/src/events/SDL_keyboard.c",
"../externals/sdl/src/events/SDL_mouse.c",
"../externals/sdl/src/events/SDL_quit.c",
"../externals/sdl/src/events/SDL_touch.c",
"../externals/sdl/src/events/SDL_windowevents.c",
"../externals/sdl/src/file/SDL_rwops.c",
"../externals/sdl/src/haptic/SDL_haptic.c",
"../externals/sdl/src/haptic/dummy/SDL_syshaptic.c",
"../externals/sdl/src/joystick/SDL_gamecontroller.c",
"../externals/sdl/src/joystick/SDL_joystick.c",
"../externals/sdl/src/joystick/dummy/SDL_sysjoystick.c",
"../externals/sdl/src/power/SDL_power.c",
"../externals/sdl/src/render/SDL_render.c",
"../externals/sdl/src/render/SDL_yuv_sw.c",
"../externals/sdl/src/render/software/SDL_blendfillrect.c",
"../externals/sdl/src/render/software/SDL_blendline.c",
"../externals/sdl/src/render/software/SDL_blendpoint.c",
"../externals/sdl/src/render/software/SDL_drawline.c",
"../externals/sdl/src/render/software/SDL_drawpoint.c",
"../externals/sdl/src/render/software/SDL_render_sw.c",
"../externals/sdl/src/render/software/SDL_rotate.c",
"../externals/sdl/src/stdlib/SDL_getenv.c",
"../externals/sdl/src/stdlib/SDL_iconv.c",
"../externals/sdl/src/stdlib/SDL_malloc.c",
"../externals/sdl/src/stdlib/SDL_qsort.c",
"../externals/sdl/src/stdlib/SDL_stdlib.c",
"../externals/sdl/src/stdlib/SDL_string.c",
"../externals/sdl/src/thread/SDL_thread.c",
"../externals/sdl/src/timer/SDL_timer.c",
"../externals/sdl/src/video/SDL_RLEaccel.c",
"../externals/sdl/src/video/SDL_blit.c",
"../externals/sdl/src/video/SDL_blit_0.c",
"../externals/sdl/src/video/SDL_blit_1.c",
"../externals/sdl/src/video/SDL_blit_A.c",
"../externals/sdl/src/video/SDL_blit_N.c",
"../externals/sdl/src/video/SDL_blit_auto.c",
"../externals/sdl/src/video/SDL_blit_copy.c",
"../externals/sdl/src/video/SDL_blit_slow.c",
"../externals/sdl/src/video/SDL_bmp.c",
"../externals/sdl/src/video/SDL_clipboard.c",
"../externals/sdl/src/video/SDL_egl.c",
"../externals/sdl/src/video/SDL_fillrect.c",
"../externals/sdl/src/video/SDL_pixels.c",
"../externals/sdl/src/video/SDL_rect.c",
"../externals/sdl/src/video/SDL_shape.c",
"../externals/sdl/src/video/SDL_stretch.c",
"../externals/sdl/src/video/SDL_surface.c",
"../externals/sdl/src/video/SDL_video.c",
]
defines = [
"HAVE_ACOS",
"HAVE_ASIN",
"HAVE_ATAN",
"HAVE_ATAN2",
"HAVE_CEIL",
"HAVE_COPYSIGN",
"HAVE_COS",
"HAVE_COSF",
"HAVE_FABS",
"HAVE_FLOOR",
"HAVE_LOG",
"HAVE_POW",
"HAVE_SCALBN",
"HAVE_SIN",
"HAVE_SINF",
"HAVE_SQRT",
"HAVE_SQRTF",
"HAVE_TAN",
"HAVE_TANF",
"SDL_HAPTIC_DISABLED=1",
"SDL_JOYSTICK_DISABLED=1",
"USING_PREMAKE_CONFIG_H",
]
libs = []
if (!is_win) {
defines += [
"SDL_LOADSO_DLOPEN=1",
"SDL_THREAD_PTHREAD=1",
"SDL_THREAD_PTHREAD_RECURSIVE_MUTEX=1",
"SDL_TIMER_UNIX=1",
]
sources += [
"../externals/sdl/src/loadso/dlopen/SDL_sysloadso.c",
"../externals/sdl/src/thread/pthread/SDL_syscond.c",
"../externals/sdl/src/thread/pthread/SDL_sysmutex.c",
"../externals/sdl/src/thread/pthread/SDL_syssem.c",
"../externals/sdl/src/thread/pthread/SDL_systhread.c",
"../externals/sdl/src/thread/pthread/SDL_systls.c",
"../externals/sdl/src/timer/unix/SDL_systimer.c",
]
}
if (is_linux) {
sources += [
"../externals/sdl/src/filesystem/unix/SDL_sysfilesystem.c",
"../externals/sdl/src/render/opengl/SDL_render_gl.c",
"../externals/sdl/src/render/opengl/SDL_shaders_gl.c",
"../externals/sdl/src/video/x11/SDL_x11clipboard.c",
"../externals/sdl/src/video/x11/SDL_x11dyn.c",
"../externals/sdl/src/video/x11/SDL_x11events.c",
"../externals/sdl/src/video/x11/SDL_x11framebuffer.c",
"../externals/sdl/src/video/x11/SDL_x11keyboard.c",
"../externals/sdl/src/video/x11/SDL_x11messagebox.c",
"../externals/sdl/src/video/x11/SDL_x11modes.c",
"../externals/sdl/src/video/x11/SDL_x11mouse.c",
"../externals/sdl/src/video/x11/SDL_x11opengl.c",
"../externals/sdl/src/video/x11/SDL_x11opengles.c",
"../externals/sdl/src/video/x11/SDL_x11shape.c",
"../externals/sdl/src/video/x11/SDL_x11touch.c",
"../externals/sdl/src/video/x11/SDL_x11video.c",
"../externals/sdl/src/video/x11/SDL_x11window.c",
"../externals/sdl/src/video/x11/SDL_x11xinput2.c",
"../externals/sdl/src/video/x11/imKStoUCS.c",
]
defines += [
"SDL_FILESYSTEM_UNIX=1",
"SDL_VIDEO_DRIVER_X11=1",
"SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS=1",
"SDL_VIDEO_OPENGL=1",
"SDL_VIDEO_RENDER_OGL=1",
"SDL_VIDEO_OPENGL_GLX=1",
]
libs += [
"GL",
"X11",
"Xext",
]
}
if (is_mac) {
sources += [
"../externals/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m",
"../externals/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m",
"../externals/sdl/src/render/opengl/SDL_render_gl.c",
"../externals/sdl/src/render/opengl/SDL_shaders_gl.c",
"../externals/sdl/src/video/cocoa/SDL_cocoaclipboard.m",
"../externals/sdl/src/video/cocoa/SDL_cocoaevents.m",
"../externals/sdl/src/video/cocoa/SDL_cocoakeyboard.m",
"../externals/sdl/src/video/cocoa/SDL_cocoamessagebox.m",
"../externals/sdl/src/video/cocoa/SDL_cocoamodes.m",
"../externals/sdl/src/video/cocoa/SDL_cocoamouse.m",
"../externals/sdl/src/video/cocoa/SDL_cocoamousetap.m",
"../externals/sdl/src/video/cocoa/SDL_cocoaopengl.m",
"../externals/sdl/src/video/cocoa/SDL_cocoashape.m",
"../externals/sdl/src/video/cocoa/SDL_cocoavideo.m",
"../externals/sdl/src/video/cocoa/SDL_cocoawindow.m",
]
defines += [
"SDL_FILESYSTEM_COCOA=1",
"SDL_VIDEO_DRIVER_COCOA=1",
"SDL_VIDEO_OPENGL=1",
"SDL_VIDEO_RENDER_OGL=1",
"SDL_VIDEO_OPENGL_CGL=1",
]
libs += [
"Carbon.framework",
"Cocoa.framework",
"Foundation.framework",
"IOKit.framework",
"QuartzCore.framework",
]
}
if (is_ios) {
sources += [
"../externals/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m",
"../externals/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m",
"../externals/sdl/src/render/opengles/SDL_render_gles.c",
"../externals/sdl/src/render/opengles2/SDL_render_gles2.c",
"../externals/sdl/src/render/opengles2/SDL_shaders_gles2.c",
"../externals/sdl/src/video/uikit/SDL_uikitappdelegate.m",
"../externals/sdl/src/video/uikit/SDL_uikitclipboard.m",
"../externals/sdl/src/video/uikit/SDL_uikitevents.m",
"../externals/sdl/src/video/uikit/SDL_uikitmessagebox.m",
"../externals/sdl/src/video/uikit/SDL_uikitmodes.m",
"../externals/sdl/src/video/uikit/SDL_uikitopengles.m",
"../externals/sdl/src/video/uikit/SDL_uikitopenglview.m",
"../externals/sdl/src/video/uikit/SDL_uikitvideo.m",
"../externals/sdl/src/video/uikit/SDL_uikitview.m",
"../externals/sdl/src/video/uikit/SDL_uikitviewcontroller.m",
"../externals/sdl/src/video/uikit/SDL_uikitwindow.m",
]
cflags_objc = [ "-fobjc-arc" ]
defines += [
"TARGET_OS_IPHONE=1",
"__IPHONE_OS__=1",
"HAVE_MATH_H=1",
"HAVE_GCC_ATOMICS=1",
"SDL_FILESYSTEM_COCOA=1",
"SDL_VIDEO_DRIVER_UIKIT=1",
"SDL_VIDEO_RENDER_OGL_ES=1",
"SDL_VIDEO_RENDER_OGL_ES2=1",
"SDL_VIDEO_OPENGL_ES=1",
"SDL_VIDEO_OPENGL_ES2=1",
]
libs += [
"Foundation.framework",
"QuartzCore.framework",
"UIKit.framework",
]
}
}