mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-12-21 04:35:23 +08:00
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
This commit is contained in:
@@ -2922,7 +2922,7 @@ endif()
|
||||
listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS)
|
||||
set(EXTRA_CFLAGS ${_EXTRA_CFLAGS})
|
||||
|
||||
file(GLOB SDL3_INCLUDE_FILES ${SDL3_SOURCE_DIR}/include/*.h)
|
||||
file(GLOB SDL3_INCLUDE_FILES ${SDL3_SOURCE_DIR}/include/SDL3/*.h)
|
||||
foreach(_hdr IN LISTS SDL3_INCLUDE_FILES)
|
||||
if(_hdr MATCHES ".*SDL_revision.h")
|
||||
list(REMOVE_ITEM SDL3_INCLUDE_FILES "${_hdr}")
|
||||
@@ -2963,8 +2963,9 @@ else()
|
||||
set(SDL_REVISION "SDL-${SDL_VERSION}-no-vcs")
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include/SDL3")
|
||||
configure_file("${SDL3_SOURCE_DIR}/include/build_config/SDL_revision.h.cmake"
|
||||
"${SDL3_BINARY_DIR}/include/SDL_revision.h")
|
||||
"${SDL3_BINARY_DIR}/include/SDL3/SDL_revision.h")
|
||||
|
||||
if(CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "" AND CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL ".lib")
|
||||
# Avoid conflict between the dll import library and the static library
|
||||
@@ -3454,7 +3455,7 @@ if(NOT SDL3_DISABLE_INSTALL)
|
||||
install(
|
||||
FILES
|
||||
${SDL3_INCLUDE_FILES}
|
||||
"${SDL3_BINARY_DIR}/include/SDL_revision.h"
|
||||
"${SDL3_BINARY_DIR}/include/SDL3/SDL_revision.h"
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SDL3)
|
||||
|
||||
install(FILES "LICENSE.txt" DESTINATION "${LICENSES_PREFIX}")
|
||||
|
||||
Reference in New Issue
Block a user