cmake: add SDL_REVISION option
This is useful if one has vendored SDL git and want to avoid rebuilding SDL on every git commit.
This commit is contained in:
@@ -2796,6 +2796,8 @@ foreach(_hdr IN LISTS SDL3_INCLUDE_FILES)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
set(SDL_REVISION "" CACHE STRING "Custom SDL revision (overrides SDL_REVISION_SUFFIX)")
|
||||||
|
if(NOT SDL_REVISION)
|
||||||
set(SDL_REVISION_SUFFIX "" CACHE STRING "Suffix for the SDL revision")
|
set(SDL_REVISION_SUFFIX "" CACHE STRING "Suffix for the SDL revision")
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt")
|
||||||
# If VERSION exists, it contains the SDL version
|
# If VERSION exists, it contains the SDL version
|
||||||
@@ -2809,6 +2811,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(SDL_REVISION "SDL-${SDL_REVISION_CENTER}${SDL_REVISION_SUFFIX}")
|
set(SDL_REVISION "SDL-${SDL_REVISION_CENTER}${SDL_REVISION_SUFFIX}")
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include/SDL3")
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${SDL3_BINARY_DIR}/include/SDL3")
|
||||||
configure_file(include/build_config/SDL_revision.h.cmake include/SDL3/SDL_revision.h @ONLY)
|
configure_file(include/build_config/SDL_revision.h.cmake include/SDL3/SDL_revision.h @ONLY)
|
||||||
|
|||||||
Reference in New Issue
Block a user