Home | History | Annotate | Download | only in libsdl
      1 # Copyright 2016 Google Inc.
      2 #
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 
      6 declare_args() {
      7 }
      8 
      9 import("../third_party.gni")
     10 
     11 third_party("libsdl") {
     12   public_include_dirs = [ "../externals/sdl/include" ]
     13 
     14   include_dirs = [ "." ]
     15   sources = [
     16     "../externals/sdl/src/SDL.c",
     17     "../externals/sdl/src/SDL_assert.c",
     18     "../externals/sdl/src/SDL_error.c",
     19     "../externals/sdl/src/SDL_hints.c",
     20     "../externals/sdl/src/SDL_log.c",
     21     "../externals/sdl/src/atomic/SDL_atomic.c",
     22     "../externals/sdl/src/atomic/SDL_spinlock.c",
     23     "../externals/sdl/src/audio/SDL_audio.c",
     24     "../externals/sdl/src/audio/SDL_audiocvt.c",
     25     "../externals/sdl/src/audio/SDL_audiodev.c",
     26     "../externals/sdl/src/audio/SDL_audiotypecvt.c",
     27     "../externals/sdl/src/audio/SDL_mixer.c",
     28     "../externals/sdl/src/audio/SDL_wave.c",
     29     "../externals/sdl/src/cpuinfo/SDL_cpuinfo.c",
     30     "../externals/sdl/src/dynapi/SDL_dynapi.c",
     31     "../externals/sdl/src/events/SDL_clipboardevents.c",
     32     "../externals/sdl/src/events/SDL_dropevents.c",
     33     "../externals/sdl/src/events/SDL_events.c",
     34     "../externals/sdl/src/events/SDL_gesture.c",
     35     "../externals/sdl/src/events/SDL_keyboard.c",
     36     "../externals/sdl/src/events/SDL_mouse.c",
     37     "../externals/sdl/src/events/SDL_quit.c",
     38     "../externals/sdl/src/events/SDL_touch.c",
     39     "../externals/sdl/src/events/SDL_windowevents.c",
     40     "../externals/sdl/src/file/SDL_rwops.c",
     41     "../externals/sdl/src/haptic/SDL_haptic.c",
     42     "../externals/sdl/src/haptic/dummy/SDL_syshaptic.c",
     43     "../externals/sdl/src/joystick/SDL_gamecontroller.c",
     44     "../externals/sdl/src/joystick/SDL_joystick.c",
     45     "../externals/sdl/src/joystick/dummy/SDL_sysjoystick.c",
     46     "../externals/sdl/src/power/SDL_power.c",
     47     "../externals/sdl/src/render/SDL_render.c",
     48     "../externals/sdl/src/render/SDL_yuv_sw.c",
     49     "../externals/sdl/src/render/software/SDL_blendfillrect.c",
     50     "../externals/sdl/src/render/software/SDL_blendline.c",
     51     "../externals/sdl/src/render/software/SDL_blendpoint.c",
     52     "../externals/sdl/src/render/software/SDL_drawline.c",
     53     "../externals/sdl/src/render/software/SDL_drawpoint.c",
     54     "../externals/sdl/src/render/software/SDL_render_sw.c",
     55     "../externals/sdl/src/render/software/SDL_rotate.c",
     56     "../externals/sdl/src/stdlib/SDL_getenv.c",
     57     "../externals/sdl/src/stdlib/SDL_iconv.c",
     58     "../externals/sdl/src/stdlib/SDL_malloc.c",
     59     "../externals/sdl/src/stdlib/SDL_qsort.c",
     60     "../externals/sdl/src/stdlib/SDL_stdlib.c",
     61     "../externals/sdl/src/stdlib/SDL_string.c",
     62     "../externals/sdl/src/thread/SDL_thread.c",
     63     "../externals/sdl/src/timer/SDL_timer.c",
     64     "../externals/sdl/src/video/SDL_RLEaccel.c",
     65     "../externals/sdl/src/video/SDL_blit.c",
     66     "../externals/sdl/src/video/SDL_blit_0.c",
     67     "../externals/sdl/src/video/SDL_blit_1.c",
     68     "../externals/sdl/src/video/SDL_blit_A.c",
     69     "../externals/sdl/src/video/SDL_blit_N.c",
     70     "../externals/sdl/src/video/SDL_blit_auto.c",
     71     "../externals/sdl/src/video/SDL_blit_copy.c",
     72     "../externals/sdl/src/video/SDL_blit_slow.c",
     73     "../externals/sdl/src/video/SDL_bmp.c",
     74     "../externals/sdl/src/video/SDL_clipboard.c",
     75     "../externals/sdl/src/video/SDL_egl.c",
     76     "../externals/sdl/src/video/SDL_fillrect.c",
     77     "../externals/sdl/src/video/SDL_pixels.c",
     78     "../externals/sdl/src/video/SDL_rect.c",
     79     "../externals/sdl/src/video/SDL_shape.c",
     80     "../externals/sdl/src/video/SDL_stretch.c",
     81     "../externals/sdl/src/video/SDL_surface.c",
     82     "../externals/sdl/src/video/SDL_video.c",
     83   ]
     84   defines = [
     85     "HAVE_ACOS",
     86     "HAVE_ASIN",
     87     "HAVE_ATAN",
     88     "HAVE_ATAN2",
     89     "HAVE_CEIL",
     90     "HAVE_COPYSIGN",
     91     "HAVE_COS",
     92     "HAVE_COSF",
     93     "HAVE_FABS",
     94     "HAVE_FLOOR",
     95     "HAVE_LOG",
     96     "HAVE_POW",
     97     "HAVE_SCALBN",
     98     "HAVE_SIN",
     99     "HAVE_SINF",
    100     "HAVE_SQRT",
    101     "HAVE_SQRTF",
    102     "HAVE_TAN",
    103     "HAVE_TANF",
    104     "SDL_HAPTIC_DISABLED=1",
    105     "SDL_JOYSTICK_DISABLED=1",
    106     "USING_PREMAKE_CONFIG_H",
    107   ]
    108   libs = []
    109 
    110   if (!is_win) {
    111     defines += [
    112       "SDL_LOADSO_DLOPEN=1",
    113       "SDL_THREAD_PTHREAD=1",
    114       "SDL_THREAD_PTHREAD_RECURSIVE_MUTEX=1",
    115       "SDL_TIMER_UNIX=1",
    116       "SDL_VIDEO_OPENGL=1",
    117       "SDL_VIDEO_RENDER_OGL=1",
    118     ]
    119     sources += [
    120       "../externals/sdl/src/loadso/dlopen/SDL_sysloadso.c",
    121       "../externals/sdl/src/render/opengl/SDL_render_gl.c",
    122       "../externals/sdl/src/render/opengl/SDL_shaders_gl.c",
    123       "../externals/sdl/src/thread/pthread/SDL_syscond.c",
    124       "../externals/sdl/src/thread/pthread/SDL_sysmutex.c",
    125       "../externals/sdl/src/thread/pthread/SDL_syssem.c",
    126       "../externals/sdl/src/thread/pthread/SDL_systhread.c",
    127       "../externals/sdl/src/thread/pthread/SDL_systls.c",
    128       "../externals/sdl/src/timer/unix/SDL_systimer.c",
    129     ]
    130   }
    131 
    132   if (is_mac) {
    133     sources += [
    134       "../externals/sdl/src/file/cocoa/SDL_rwopsbundlesupport.m",
    135       "../externals/sdl/src/filesystem/cocoa/SDL_sysfilesystem.m",
    136       "../externals/sdl/src/video/cocoa/SDL_cocoaclipboard.m",
    137       "../externals/sdl/src/video/cocoa/SDL_cocoaevents.m",
    138       "../externals/sdl/src/video/cocoa/SDL_cocoakeyboard.m",
    139       "../externals/sdl/src/video/cocoa/SDL_cocoamessagebox.m",
    140       "../externals/sdl/src/video/cocoa/SDL_cocoamodes.m",
    141       "../externals/sdl/src/video/cocoa/SDL_cocoamouse.m",
    142       "../externals/sdl/src/video/cocoa/SDL_cocoamousetap.m",
    143       "../externals/sdl/src/video/cocoa/SDL_cocoaopengl.m",
    144       "../externals/sdl/src/video/cocoa/SDL_cocoashape.m",
    145       "../externals/sdl/src/video/cocoa/SDL_cocoavideo.m",
    146       "../externals/sdl/src/video/cocoa/SDL_cocoawindow.m",
    147     ]
    148     defines += [
    149       "SDL_FILESYSTEM_COCOA=1",
    150       "SDL_VIDEO_DRIVER_COCOA=1",
    151       "SDL_VIDEO_OPENGL_CGL=1",
    152     ]
    153     libs += [
    154       "Carbon.framework",
    155       "IOKit.framework",
    156     ]
    157   }
    158 }
    159