Commit graph

540 commits

Author SHA1 Message Date
Anonymous Maarten 9f2ca87504 build: don't add SDL3 subfolder to include path for external projects 2022-11-27 14:33:13 -08:00
Sam Lantinga 2af4f74e1c Remove sdl3.m4 and sdl3-config, and document pkg-config as the recommended replacement
Fixes https://github.com/libsdl-org/SDL/issues/6639
2022-11-27 14:11:06 -08:00
Sam Lantinga 0a48abc860 Switch header convention from #include "SDL.h" to #include <SDL3/SDLh>
I ran this script in the include directory:
```sh
sed -i '' -e 's,#include "\(SDL.*\)",#include <SDL3/\1>,' *.h
```

I ran this script in the src directory:
```sh
for i in ../include/SDL3/SDL*.h
do hdr=$(basename $i)
   if [ x"$(echo $hdr | egrep 'SDL_main|SDL_name|SDL_test|SDL_syswm|SDL_opengl|SDL_egl|SDL_vulkan')" != x ]; then
        find . -type f -exec sed -i '' -e 's,#include "\('$hdr'\)",#include <SDL3/\1>,' {} \;
    else
        find . -type f -exec sed -i '' -e '/#include "'$hdr'"/d' {} \;
    fi
done
```

Fixes https://github.com/libsdl-org/SDL/issues/6575
2022-11-26 22:15:18 -08:00
Sam Lantinga e4b97c42b3 cmake: avoid copy of headers by moving generated headers to include/build_config (thanks @madebr!)
Shove all build system generated headers in include/build_config.
Doing this, cmake does not need to copy the headers anymore.
This was done for external projects vendoring SDL.

See https://github.com/libsdl-org/SDL/issues/6641#issuecomment-1328092535
2022-11-26 15:37:08 -08:00
Sam Lantinga bde808cd87 Fixed some warnings when building on Linux with -DSDL_LIBC=OFF 2022-11-26 05:18:26 -08:00
Sam Lantinga 63f307fe1f Remove SDL_config.h from the public headers
The SDL headers are no longer dependent on the build configuration.

Fixes https://github.com/libsdl-org/SDL/issues/6643 and https://github.com/libsdl-org/SDL/issues/6641
2022-11-26 04:48:36 -08:00
Sam Lantinga cc1f9eb983 Use Apple's nomenclature for macOS and iOS
Fixes https://github.com/libsdl-org/SDL/issues/6621
2022-11-25 16:00:06 -08:00
Anonymous Maarten 716821ca67 autotools: remove SDL3.spec.in 2022-11-25 15:37:30 -08:00
Anonymous Maarten 95b0712033 cmake: don't create libSDL3.so symbolic link at install time 2022-11-25 12:57:32 -08:00
Simon McVittie 7ef38beb7e build: Simplify library name
We want the library to come out as libSDL3.so.0 on Unix, or something
similar on other platforms. There's no need to have libSDL3-3.0.so.0,
because next time we intentionally break the API it should become libSDL4
anyway.

Partially implements #5626.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-11-25 12:57:32 -08:00
Anonymous Maarten 4574c16178 cmake: test for lsx and lasx intrinsics for loongarch 2022-11-25 21:50:08 +01:00
Anonymous Maarten d1f423d9db cmake: make all assembly options depend on SDL_ASSEMBLY and architecture 2022-11-25 21:50:08 +01:00
Anonymous Maarten d0e14008b5 cmake: find libudev library so it gets priority 2022-11-25 21:36:53 +01:00
Anonymous Maarten 1bbff6596c cmake: add support for some BSD's wscons input 2022-11-25 21:36:53 +01:00
Ozkan Sezer 1e4cd682b3 removed M_PI detection from cmake, removed HAVE_M_PI from config files.
(didn't touch autofoo side for it so as not to break PR/6605)
2022-11-25 22:35:40 +03:00
Anonymous Maarten ecd36c8f07 cmake: fix typo's in last commit 2022-11-25 04:31:25 +01:00
Anonymous Maarten c9b8559af5 cmake: use option to pass extra check options instead of hardcoding them 2022-11-25 03:15:30 +01:00
Anonymous Maarten c069ff1586 cmake: add /usr/local/include to check include directories 2022-11-24 23:33:59 +01:00
Anonymous Maarten cd13600944 cmake: don't reset check state after pushing state 2022-11-24 23:33:54 +01:00
Cameron Cawley 84781a7b6f
Disable the offscreen video driver if EGL is unavailable (#6234) 2022-11-23 10:55:34 -08:00
Sam Lantinga a635a485bc Re-added WinRT support until we're sure that it's no longer being used 2022-11-23 10:41:43 -08:00
Ozkan Sezer 34231f5ba0 reverted opengles removal. 2022-11-23 18:50:02 +03:00
Ozkan Sezer 5db60670ba removed linkage to OpenGLES framework 2022-11-23 07:47:00 +03:00
Ozkan Sezer 016b757311 reverted jack audio backend removal. 2022-11-23 06:50:20 +03:00
Ozkan Sezer dc2a3e06e9 removed WinRT support. 2022-11-22 23:36:24 +03:00
Ozkan Sezer 7df102d220 reverted sndio backend removal. 2022-11-22 22:04:10 +03:00
Ozkan Sezer 30b1ab2add removed opengles. 2022-11-22 21:48:40 +03:00
Ozkan Sezer 3aea865cdf removed directfb support. 2022-11-22 20:45:45 +03:00
Ozkan Sezer cdb54ad21e removed arts, esd, fusionsound, nas, paudio, sndio, sunaudio, winmm audio backends. 2022-11-22 19:51:56 +03:00
pionere 68b30d24e0 cmake: get rid of the duplicated _USE_MATH_DEFINES
- define _USE_MATH_DEFINES in SDL_stdinc.h only
- define _USE_MATH_DEFINES if not defined already
2022-11-22 08:31:35 -08:00
Ozkan Sezer 8d6fda4810 removed os2 support & support for building SDL with watcom. 2022-11-22 19:18:47 +03:00
Sam Lantinga 2c4159b99a First pass at changing SDL 2.0 to SDL 3.0 2022-11-21 20:28:58 -08:00
Sam Lantinga 0bfeed061b Updated to version 2.26.0 for release 2022-11-21 16:15:58 -08:00
Sam Lantinga 8ae46a49ea Save the version in VERSION.txt instead of VERSION
Fixes https://github.com/libsdl-org/SDL/issues/6558
2022-11-21 06:57:02 -08:00
Sam Lantinga 802c624ab3 Strip trailing newline when reading the VERSION file 2022-11-20 14:37:05 -08:00
Ozkan Sezer 3bc4bad8fb add missing strcasestr checks to cmake and autotools build systems,
and update config files.
2022-11-20 14:20:33 -08:00
Sam Lantinga 78ea6af2cd Updated to version 2.25.1 for release candidate 2022-11-17 09:01:35 -08:00
Anonymous Maarten 819b0143e3 cmake: enable SDL_TEST by default for emscripten 2022-11-16 15:42:08 +01:00
Anonymous Maarten 55384db8a6 cmake: emscripten has libunwind.h, libunwind.a has missing symbols 2022-11-16 15:42:08 +01:00
Anonymous Maarten 6e46090a30 cmake: check ALL headers inside the look (including sys/types.h) 2022-11-16 15:42:08 +01:00
Anonymous Maarten 500bac0b13 cmake: include FIndPkgConfig.cmake through find_package 2022-11-16 15:42:08 +01:00
Pierre Wendling a71ad40ac3
CMake: Add option to use Ccache. 2022-11-15 19:04:22 +01:00
Sam Lantinga 9f8b68a278 Fixed building without linux/input.h
https://github.com/libsdl-org/SDL/issues/6169
2022-11-11 10:25:52 -08:00
Anonymous Maarten 61297f703a cmake: on Apple, check for presence of an OBJC compiler 2022-11-03 15:03:47 +01:00
Luca Lolli b50e429354 Fix compilation for .m files extension 2022-11-03 15:03:47 +01:00
Anonymous Maarten 4c704ecfdd cmake: use SDL2-static as static library output name when prefix/static == ""/".lib"
Apparently, some clang@Windows compilers do this.
2022-11-01 13:53:09 -07:00
Anonymous Maarten c3b13346e0 On x86, pass -nodefaultlib to linker when wanting to avoid the C library 2022-10-22 09:28:00 -07:00
Simon McVittie 4ca5ea5b7e build: Add a mechanism to mark builds with vendor info
Downstream distributors can use this to mark a version with their
preferred version information, like a Linux distribution package version
or the Steam revision it was built to be bundled into, or just to mark
it with the vendor it was built by or the environment it's intended to
be used in.

For instance, in Debian I'd use this by configuring with:

    --enable-vendor-info="${DEB_VENDOR} ${DEB_VERSION}"

to get a SDL_REVISION like:

    release-2.24.1-0-ga1d1946dc (Debian 2.24.1+dfsg-2)

which gives a Debian user enough information to track down the patches
and build-time configuration that were used for package revision 2.

In Autotools and CMake, this is a configure-time option like any other,
and will go into both SDL_REVISION (via SDL_revision.h) and
SDL_GetRevision().

In other build systems (MSVC, Xcode, etc.), defining the
SDL_VENDOR_INFO macro will get it into the output of SDL_GetRevision(),
although not SDL_REVISION.

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Simon McVittie 2dc788cb9f build: Expand version info in SDL_REVISION and SDL_GetRevision()
Instead of using a URL and git sha1, this uses `git describe` to
describe the version relative to the nearest previous git tag, which
gives a better indication of whether this is a release, a prerelease,
a slightly patched prerelease, or a long way after the last release
during active development.

This serves two purposes: it makes those APIs more informative, and it
also puts this information into the binary in a form that is easy to
screen-scrape using strings(1). For instance, if the bundled version of
SDL in a game has this, we can see at a glance what version it is.

It's also shorter than using the web address of the origin git
repository and the full git commit sha1.

Also write the computed version into a file ./VERSION in `make dist`
tarballs, so that when we build from a tarball on a system that doesn't
have git available, we still get the version details.

For the Perforce code path in showrev.sh, output the version number
followed by the Perforce revision, in a format reminiscent of
`git describe` (with p instead of g to indicate Perforce).

For the code path with no VCS available at all, put a suffix on the
version number to indicate that this is just a guess (we can't know
whether this SDL version is actually a git snapshot or has been
patched locally or similar).

Resolves: https://github.com/libsdl-org/SDL/issues/6418
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-10-22 09:27:10 -07:00
Anonymous Maarten 5ed091c12d cmake: fix reporting of SDL_TESTS 2022-10-21 15:32:05 +02:00