diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/docs/README-porting.md | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/docs/README-porting.md')
| -rw-r--r-- | contrib/SDL-3.2.8/docs/README-porting.md | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/docs/README-porting.md b/contrib/SDL-3.2.8/docs/README-porting.md new file mode 100644 index 0000000..ada1d67 --- /dev/null +++ b/contrib/SDL-3.2.8/docs/README-porting.md | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | Porting | ||
| 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 | ||
| 7 | include/SDL_platform.h and create an entry there for your operating system. | ||
| 8 | The standard format is "SDL_PLATFORM_X", where X is the name of the OS. | ||
| 9 | Ideally SDL_platform_defines.h will be able to auto-detect the system it's building | ||
| 10 | on based on C preprocessor symbols. | ||
| 11 | |||
| 12 | There are two basic ways of building SDL at the moment: | ||
| 13 | |||
| 14 | 1. 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 | |||
| 24 | 2. 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 | |||
| 57 | Once you have a working library without any drivers, you can go back to each | ||
| 58 | of the major subsystems and start implementing drivers for your platform. | ||
| 59 | |||
| 60 | If you have any questions, don't hesitate to ask on the SDL mailing list: | ||
| 61 | http://www.libsdl.org/mailing-list.php | ||
| 62 | |||
| 63 | Enjoy! | ||
| 64 | Sam Lantinga (slouken@libsdl.org) | ||
| 65 | |||
