add 'Misc' subsystem
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4ea5654..b8e2278 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -361,7 +361,7 @@ set(LONGESTOPTIONNAME 0) # set_option and friends will change this.
set(SDL_SUBSYSTEMS
Atomic Audio Video Render Events Joystick Haptic Hidapi Power Threads Timers
- File Loadso CPUinfo Filesystem Dlopen Sensor Locale)
+ File Loadso CPUinfo Filesystem Dlopen Sensor Locale Misc)
foreach(_SUB ${SDL_SUBSYSTEMS})
string(TOUPPER ${_SUB} _OPT)
if (NOT DEFINED SDL_${_OPT}_ENABLED_BY_DEFAULT)
@@ -1037,9 +1037,11 @@ if(ANDROID)
file(GLOB ANDROID_CORE_SOURCES ${SDL2_SOURCE_DIR}/src/core/android/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_CORE_SOURCES} ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
- file(GLOB ANDROID_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/android/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
+ if(SDL_MISC)
+ file(GLOB ANDROID_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/android/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${ANDROID_MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
+ endif()
# SDL_spinlock.c Needs to be compiled in ARM mode.
# There seems to be no better way currently to set the ARM mode.
@@ -1449,9 +1451,11 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT RISCOS AND NOT HAIKU)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_LINUX_VERSION_H")
endif()
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/unix/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
+ if(SDL_MISC)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/unix/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
+ endif()
if(SDL_POWER)
if(LINUX)
@@ -1523,14 +1527,15 @@ elseif(WINDOWS)
endif()
endif()
- if(WINDOWS_STORE)
- file(GLOB WINRT_MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp)
- set(SOURCE_FILES ${SOURCE_FILES} ${WINRT_MISC_SOURCES})
- else()
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/windows/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ if(SDL_MISC)
+ if(WINDOWS_STORE)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/winrt/*.cpp)
+ else()
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/windows/*.c)
+ endif()
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
endif()
- set(HAVE_SDL_MISC TRUE)
# Check for DirectX
if(SDL_DIRECTX)
@@ -1825,14 +1830,16 @@ elseif(APPLE)
message_error("SDL_FILE must be enabled to build on MacOS X")
endif()
- if(IOS OR TVOS)
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m)
- file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
- else()
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
+ if(SDL_MISC)
+ if(IOS OR TVOS)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/ios/*.m)
+ file(GLOB SDLMAIN_SOURCES ${SDL2_SOURCE_DIR}/src/main/uikit/*.c)
+ else()
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/macosx/*.m)
+ endif()
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
endif()
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_COREAUDIO 1)
@@ -2127,9 +2134,11 @@ elseif(HAIKU)
set(HAVE_SDL_JOYSTICK TRUE)
endif()
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/haiku/*.cc)
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
+ if(SDL_MISC)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/haiku/*.cc)
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
+ endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_HAIKU 1)
@@ -2181,9 +2190,11 @@ elseif(HAIKU)
list(APPEND EXTRA_LIBS root be media game device textencoding)
elseif(RISCOS)
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/riscos/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
+ if(SDL_MISC)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/riscos/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
+ endif()
if(SDL_VIDEO)
set(SDL_VIDEO_DRIVER_RISCOS 1)
@@ -2223,9 +2234,11 @@ elseif(VITA)
set_source_files_properties(${SDL2_SOURCE_DIR}/src/atomic/SDL_spinlock.c PROPERTIES COMPILE_FLAGS -marm)
endif()
- file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/vita/*.c)
- set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
- set(HAVE_SDL_MISC TRUE)
+ if(SDL_MISC)
+ file(GLOB MISC_SOURCES ${SDL2_SOURCE_DIR}/src/misc/vita/*.c)
+ set(SOURCE_FILES ${SOURCE_FILES} ${MISC_SOURCES})
+ set(HAVE_SDL_MISC TRUE)
+ endif()
if(SDL_AUDIO)
set(SDL_AUDIO_DRIVER_VITA 1)
diff --git a/include/SDL_config.h.cmake b/include/SDL_config.h.cmake
index ee4ffeb..af135c9 100644
--- a/include/SDL_config.h.cmake
+++ b/include/SDL_config.h.cmake
@@ -278,6 +278,7 @@
#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@
#cmakedefine SDL_FILESYSTEM_DISABLED @SDL_FILESYSTEM_DISABLED@
#cmakedefine SDL_LOCALE_DISABLED @SDL_LOCALE_DISABLED@
+#cmakedefine SDL_MISC_DISABLED @SDL_MISC_DISABLED@
/* Enable various audio drivers */
#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@
diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in
index a6ab901..5ef2c15 100644
--- a/include/SDL_config.h.in
+++ b/include/SDL_config.h.in
@@ -264,6 +264,7 @@
#undef SDL_POWER_DISABLED
#undef SDL_FILESYSTEM_DISABLED
#undef SDL_LOCALE_DISABLED
+#undef SDL_MISC_DISABLED
/* Enable various audio drivers */
#undef SDL_AUDIO_DRIVER_AAUDIO