summaryrefslogtreecommitdiff
path: root/src/contrib/SDL-3.2.20/docs/README-porting.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/contrib/SDL-3.2.20/docs/README-porting.md')
-rw-r--r--src/contrib/SDL-3.2.20/docs/README-porting.md65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/contrib/SDL-3.2.20/docs/README-porting.md b/src/contrib/SDL-3.2.20/docs/README-porting.md
new file mode 100644
index 0000000..ada1d67
--- /dev/null
+++ b/src/contrib/SDL-3.2.20/docs/README-porting.md
@@ -0,0 +1,65 @@
1Porting
2=======
3
4* Porting To A New Platform
5
6 The first thing you have to do when porting to a new platform, is look at
7include/SDL_platform.h and create an entry there for your operating system.
8The standard format is "SDL_PLATFORM_X", where X is the name of the OS.
9Ideally SDL_platform_defines.h will be able to auto-detect the system it's building
10on based on C preprocessor symbols.
11
12There are two basic ways of building SDL at the moment:
13
141. CMake: cmake -S . -B build && cmake --build build && cmake --install install
15
16 If you have a system that supports CMake, then you might try this. Edit CMakeLists.txt,
17
18 take a look at the large section labelled:
19
20 "Platform-specific options and settings!"
21
22 Add a section for your platform, and then re-run 'cmake -S . -B build' and build!
23
242. Using an IDE:
25
26 If you're using an IDE or other non-configure build system, you'll probably want to create a custom `SDL_build_config.h` for your platform. Edit `include/build_config/SDL_build_config.h`, add a section for your platform, and create a custom `SDL_build_config_{platform}.h`, based on `SDL_build_config_minimal.h` and `SDL_build_config.h.cmake`
27
28 Add the top level include directory to the header search path, and then add
29 the following sources to the project:
30
31 src/*.c
32 src/atomic/*.c
33 src/audio/*.c
34 src/cpuinfo/*.c
35 src/events/*.c
36 src/file/*.c
37 src/haptic/*.c
38 src/joystick/*.c
39 src/power/*.c
40 src/render/*.c
41 src/render/software/*.c
42 src/stdlib/*.c
43 src/thread/*.c
44 src/timer/*.c
45 src/video/*.c
46 src/audio/disk/*.c
47 src/audio/dummy/*.c
48 src/filesystem/dummy/*.c
49 src/video/dummy/*.c
50 src/haptic/dummy/*.c
51 src/joystick/dummy/*.c
52 src/thread/generic/*.c
53 src/timer/dummy/*.c
54 src/loadso/dummy/*.c
55
56
57Once you have a working library without any drivers, you can go back to each
58of the major subsystems and start implementing drivers for your platform.
59
60If you have any questions, don't hesitate to ask on the SDL mailing list:
61 http://www.libsdl.org/mailing-list.php
62
63Enjoy!
64 Sam Lantinga (slouken@libsdl.org)
65