Remove sdl3.m4 and sdl3-config, and document pkg-config as the recommended replacement
Fixes https://github.com/libsdl-org/SDL/issues/6639
This commit is contained in:
@@ -76,12 +76,11 @@ NSApplicationDelegate implementation:
|
||||
|
||||
# Using the Simple DirectMedia Layer with a traditional Makefile
|
||||
|
||||
An existing build system for your SDL app has good chances
|
||||
|
||||
to work almost unchanged on macOS. However, to produce a "real" Mac binary
|
||||
that you can distribute to users, you need to put the generated binary into a
|
||||
so called "bundle", which is basically a fancy folder with a name like
|
||||
"MyCoolGame.app".
|
||||
An existing build system for your SDL app has good chances to work almost
|
||||
unchanged on macOS, as long as you link with the SDL framework. However,
|
||||
to produce a "real" Mac binary that you can distribute to users, you need
|
||||
to put the generated binary into a so called "bundle", which is basically
|
||||
a fancy folder with a name like "MyCoolGame.app".
|
||||
|
||||
To get this build automatically, add something like the following rule to
|
||||
your Makefile.am:
|
||||
@@ -124,24 +123,8 @@ But beware! That is only part of the story! With the above, you end up with
|
||||
a barebones .app bundle, which is double-clickable from the Finder. But
|
||||
there are some more things you should do before shipping your product...
|
||||
|
||||
1. The bundle right now probably is dynamically linked against SDL. That
|
||||
means that when you copy it to another computer, *it will not run*,
|
||||
unless you also install SDL on that other computer. A good solution
|
||||
for this dilemma is to static link against SDL. On macOS, you can
|
||||
achieve that by linking against the libraries listed by
|
||||
|
||||
```bash
|
||||
sdl3-config --static-libs
|
||||
```
|
||||
|
||||
instead of those listed by
|
||||
|
||||
```bash
|
||||
sdl3-config --libs
|
||||
```
|
||||
|
||||
Depending on how exactly SDL is integrated into your build systems, the
|
||||
way to achieve that varies, so I won't describe it here in detail
|
||||
1. You'll need to copy the SDL framework into the Contents/Frameworks
|
||||
folder in your bundle, so it is included along with your application.
|
||||
|
||||
2. Add an 'Info.plist' to your application. That is a special XML file which
|
||||
contains some meta-information about your application (like some copyright
|
||||
|
||||
@@ -6,6 +6,28 @@ We have provided a handy Python script to automate some of this work for you [li
|
||||
|
||||
SDL headers should now be included as `#include <SDL3/SDL.h>`. Typically that's the only header you'll need in your application unless you are using OpenGL or Vulkan functionality.
|
||||
|
||||
CMake users should use this snippet to include SDL support in their project:
|
||||
```
|
||||
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
|
||||
find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3main)
|
||||
if(TARGET SDL3::SDL3main)
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3main)
|
||||
endif()
|
||||
target_link_libraries(mygame PRIVATE SDL3::SDL3)
|
||||
```
|
||||
|
||||
Autotools users should use this snippet to include SDL support in their project:
|
||||
```
|
||||
PKG_CHECK_MODULES([SDL3], [sdl3])
|
||||
```
|
||||
and then add $SDL3_CFLAGS to their project CFLAGS and $SDL3_LIBS to their project LDFLAGS
|
||||
|
||||
Makefile users can use this snippet to include SDL support in their project:
|
||||
```
|
||||
CFLAGS += $(shell pkg-config sdl3 --cflags)
|
||||
LDFLAGS += $(shell pkg-config sdl3 --libs)
|
||||
```
|
||||
|
||||
|
||||
## SDL_platform.h
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ The final step is compiling SDL itself.
|
||||
|
||||
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
|
||||
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc ./rpi-sdl3-installed/bin/sdl3-config
|
||||
perl -w -pi -e "s#$PWD/rpi-sdl3-installed#/usr/local#g;" ./rpi-sdl3-installed/lib/libSDL3.la ./rpi-sdl3-installed/lib/pkgconfig/sdl3.pc
|
||||
|
||||
Apps don't work or poor video/audio performance
|
||||
-----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user