TestBigEndian got deprecated, so better endian check (#514)

* TestBigEndian got deprecated

with this and the patch for BRender-v1.3.2 repo this matter should be done now.

* Update minimum required CMake version to 3.20

---------

Co-authored-by: Dethrace Engineering Department <78985374+dethrace-labs@users.noreply.github.com>
This commit is contained in:
Link4Electronics 2026-01-04 23:33:20 -03:00 committed by GitHub
parent ea488564ca
commit 5fb8161e0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.20)
if(NOT DEFINED CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo" FORCE)
@ -15,7 +15,6 @@ endif()
include(CheckCCompilerFlag)
include(CMakeDependentOption)
include(TestBigEndian)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DETHRACE_VERSION)
@ -86,7 +85,16 @@ function(add_compile_flags_if_supported TARGET)
endforeach()
endfunction()
test_big_endian(IS_BIGENDIAN)
if(CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
set(WORDS_BIGENDIAN TRUE)
add_definitions(-DBR_ENDIAN_BIG=1 -DBR_ENDIAN_LITTLE=0)
elseif(CMAKE_C_BYTE_ORDER STREQUAL "LITTLE_ENDIAN")
set(WORDS_BIGENDIAN FALSE)
add_definitions(-DBR_ENDIAN_BIG=0 -DBR_ENDIAN_LITTLE=1)
else()
set(WORDS_BIGENDIAN FALSE)
message(WARNING "Endianness could not be determined.")
endif()
set(count_sdl_platforms 0)