-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates and fixes to build_configs #11397
Conversation
402151a
to
44ae21d
Compare
@madebr, can you take a look at this? It mostly looks good to me, I just want a second pair of eyes on this. |
@madebr, ping? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for painstakingly checking the configure options, and removing the ones that we didn't use anymore.
#cmakedefine HAVE_ICONV_H 1 | ||
#cmakedefine HAVE_INTTYPES_H 1 | ||
#cmakedefine HAVE_LIBUNWIND_H 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro can be removed from all SDL_build_config*
headers. It's only used by SDL_test, which does not use the config header.
@@ -144,6 +129,7 @@ | |||
#cmakedefine HAVE_CEILF 1 | |||
#cmakedefine HAVE_COPYSIGN 1 | |||
#cmakedefine HAVE_COPYSIGNF 1 | |||
#cmakedefine HAVE__COPYSIGN 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should _copysign
be tested in CMakeLists.txt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's available in Windows builds.
@@ -182,6 +168,7 @@ | |||
#cmakedefine HAVE_TANF 1 | |||
#cmakedefine HAVE_TRUNC 1 | |||
#cmakedefine HAVE_TRUNCF 1 | |||
#cmakedefine HAVE__FSEEKI64 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add this one to CMakeLists.txt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, also available in Windows builds.
#cmakedefine SDL_REVISION "@SDL_REVISION@ (" SDL_VENDOR_INFO ")" | ||
#else | ||
#define SDL_REVISION "@SDL_REVISION@" | ||
#cmakedefine SDL_REVISION "@SDL_REVISION@" | ||
#endif | ||
|
||
#ifndef SDL_REVISION | ||
#ifdef SDL_VENDOR_INFO | ||
#define SDL_REVISION SDL_VENDOR_INFO | ||
#else | ||
#define SDL_REVISION "" | ||
#endif | ||
#endif | ||
|
||
#ifndef SDL_VENDOR_INFO | ||
#define SDL_VENDOR_INFO "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has changed in current SDL3 main.
The CMake script always defines a SDL_REVISION
string, and optionally adds a vendor info string.
Please verify, but I think the current SDL_revision.h.cmake can remain as is.
Those are only used in build_config files that define them themselves, or not used at all.
Those are defined in other build_configs files and used elsewhere in SDL.
Currently, `SDL_DEFAULT_ASSERT_LEVEL` is commented out by CMake when its value is 0, setting the assertions level to the default value instead of disabling them. This change: - defines `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` when its value is non-zero. - defines `SDL_DEFAULT_ASSERT_LEVEL`, regardless of its value, when `SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED` is defined.
Makes all macros only used in `#ifdef`s defined as `1` when they exist, instead of the CMake value of the corresponding variable.
I messed up some spacing, so I thought I might as well strip all those unnecessary spaces.
It is only used in SDL_test, which does not use the config header.
44ae21d
to
1e19fda
Compare
Rebased and fixed the issues:
|
Looks good, thanks! |
Adds missing macro definitions to
SDL_build_config.h.cmake
, removes unused ones, changes unneeded@VAR@
replacements to1
s, and fixes a few little things.Those are issues I came across while working with
SDL_build_config.h.cmake
for a personal project that uses CMake configuration headers, but not CMake itself.