CMakeLists.txt
changeset 11207 4ed2e42b7497
parent 11175 cbc6a8a5b701
child 11210 c92070a96da5
     1.1 --- a/CMakeLists.txt	Wed Aug 09 16:20:04 2017 -0700
     1.2 +++ b/CMakeLists.txt	Thu Jun 08 22:07:55 2017 +0300
     1.3 @@ -159,6 +159,10 @@
     1.4    set(OPT_DEF_ASM FALSE)
     1.5  endif()
     1.6  
     1.7 +if(USE_GCC OR USE_CLANG)
     1.8 +  set(OPT_DEF_GCC_ATOMICS ON)
     1.9 +endif()
    1.10 +
    1.11  # Default flags, if not set otherwise
    1.12  if("$ENV{CFLAGS}" STREQUAL "")
    1.13    if(CMAKE_BUILD_TYPE STREQUAL "")
    1.14 @@ -257,7 +261,7 @@
    1.15  option_string(ASSERTIONS "Enable internal sanity checks (auto/disabled/release/enabled/paranoid)" "auto")
    1.16  #set_option(DEPENDENCY_TRACKING "Use gcc -MMD -MT dependency tracking" ON)
    1.17  set_option(LIBC                "Use the system C library" ${OPT_DEF_LIBC})
    1.18 -set_option(GCC_ATOMICS         "Use gcc builtin atomics" ${USE_GCC})
    1.19 +set_option(GCC_ATOMICS         "Use gcc builtin atomics" ${OPT_DEF_GCC_ATOMICS})
    1.20  set_option(ASSEMBLY            "Enable assembly routines" ${OPT_DEF_ASM})
    1.21  set_option(SSEMATH             "Allow GCC to use SSE floating point math" ${OPT_DEF_SSEMATH})
    1.22  set_option(MMX                 "Use MMX assembly routines" ${OPT_DEF_ASM})
    1.23 @@ -792,12 +796,24 @@
    1.24      set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_JOYSTICK_SOURCES})
    1.25      set(HAVE_SDL_JOYSTICK TRUE)
    1.26    endif()
    1.27 +  if(SDL_LOADSO)
    1.28 +    set(SDL_LOADSO_DLOPEN 1)
    1.29 +    file(GLOB LOADSO_SOURCES ${SDL2_SOURCE_DIR}/src/loadso/dlopen/*.c)
    1.30 +    set(SOURCE_FILES ${SOURCE_FILES} ${LOADSO_SOURCES})
    1.31 +    set(HAVE_SDL_LOADSO TRUE)
    1.32 +  endif()
    1.33    if(SDL_POWER)
    1.34      set(SDL_POWER_ANDROID 1)
    1.35      file(GLOB ANDROID_POWER_SOURCES ${SDL2_SOURCE_DIR}/src/power/android/*.c)
    1.36      set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_POWER_SOURCES})
    1.37      set(HAVE_SDL_POWER TRUE)
    1.38    endif()
    1.39 +  if(SDL_TIMERS)
    1.40 +    set(SDL_TIMER_UNIX 1)
    1.41 +    file(GLOB TIMER_SOURCES ${SDL2_SOURCE_DIR}/src/timer/unix/*.c)
    1.42 +    set(SOURCE_FILES ${SOURCE_FILES} ${TIMER_SOURCES})
    1.43 +    set(HAVE_SDL_TIMERS TRUE)
    1.44 +  endif()
    1.45    if(SDL_VIDEO)
    1.46      set(SDL_VIDEO_DRIVER_ANDROID 1)
    1.47      file(GLOB ANDROID_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/android/*.c)
    1.48 @@ -823,6 +839,9 @@
    1.49        list(APPEND EXTRA_LIBS ${OpenGLES1_LIBRARY} ${OpenGLES2_LIBRARY})
    1.50      endif()
    1.51    endif()
    1.52 +
    1.53 +  CheckPTHREAD()
    1.54 +
    1.55    list(APPEND EXTRA_LDFLAGS "-Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit")
    1.56  endif()
    1.57