2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-21 17:36:18 +01:00

Update library naming for RISC-V and MIPS64 support

This commit is contained in:
Alibek Omarov 2021-10-27 21:22:01 +03:00
parent 5c6b660e94
commit d7123abd50
2 changed files with 54 additions and 10 deletions

View File

@ -1,6 +1,7 @@
include(CheckSymbolExists)
# generated(see comments in public/build.h)
# cat build.h | grep '^#undef XASH' | awk '{ print "check_symbol_exists(" $2 " \"build.h\" " $2 ")" }'
set(CMAKE_REQUIRED_INCLUDES "${PROJECT_SOURCE_DIR}/public/")
check_symbol_exists(XASH_64BIT "build.h" XASH_64BIT)
check_symbol_exists(XASH_AMD64 "build.h" XASH_AMD64)
@ -16,9 +17,11 @@ check_symbol_exists(XASH_ARMv7 "build.h" XASH_ARMv7)
check_symbol_exists(XASH_ARMv8 "build.h" XASH_ARMv8)
check_symbol_exists(XASH_BIG_ENDIAN "build.h" XASH_BIG_ENDIAN)
check_symbol_exists(XASH_BSD "build.h" XASH_BSD)
check_symbol_exists(XASH_DOS4GW "build.h" XASH_DOS4GW)
check_symbol_exists(XASH_E2K "build.h" XASH_E2K)
check_symbol_exists(XASH_EMSCRIPTEN "build.h" XASH_EMSCRIPTEN)
check_symbol_exists(XASH_FREEBSD "build.h" XASH_FREEBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU)
check_symbol_exists(XASH_IOS "build.h" XASH_IOS)
check_symbol_exists(XASH_JS "build.h" XASH_JS)
check_symbol_exists(XASH_LINUX "build.h" XASH_LINUX)
@ -29,7 +32,11 @@ check_symbol_exists(XASH_MOBILE_PLATFORM "build.h" XASH_MOBILE_PLATFORM)
check_symbol_exists(XASH_MSVC "build.h" XASH_MSVC)
check_symbol_exists(XASH_NETBSD "build.h" XASH_NETBSD)
check_symbol_exists(XASH_OPENBSD "build.h" XASH_OPENBSD)
check_symbol_exists(XASH_HAIKU "build.h" XASH_HAIKU)
check_symbol_exists(XASH_POSIX "build.h" XASH_POSIX)
check_symbol_exists(XASH_RISCV "build.h" XASH_RISCV)
check_symbol_exists(XASH_RISCV_DOUBLEFP "build.h" XASH_RISCV_DOUBLEFP)
check_symbol_exists(XASH_RISCV_SINGLEFP "build.h" XASH_RISCV_SINGLEFP)
check_symbol_exists(XASH_RISCV_SOFTFP "build.h" XASH_RISCV_SOFTFP)
check_symbol_exists(XASH_WIN32 "build.h" XASH_WIN32)
check_symbol_exists(XASH_WIN64 "build.h" XASH_WIN64)
check_symbol_exists(XASH_X86 "build.h" XASH_X86)
@ -81,10 +88,28 @@ elseif(XASH_ARM)
else()
set(BUILDARCH "${BUILDARCH}l")
endif()
elseif(XASH_MIPS AND XASH_BIG_ENDIAN)
elseif(XASH_MIPS)
set(BUILDARCH "mips")
elseif(XASH_MIPS AND XASH_LITTLE_ENDIAN)
set(BUILDARCH "mipsel")
if(XASH_64BIT)
set(BUILDARCH "${BUILDARCH}64")
endif()
if(XASH_LITTLE_ENDIAN)
set(BUILDARCH "${BUILDARCH}el")
endif()
elseif(XASH_RISCV)
set(BUILDARCH "riscv")
if(XASH_64BIT)
set(BUILDARCH "${BUILDARCH}64")
else()
set(BUILDARCH "${BUILDARCH}32")
endif()
if(XASH_RISCV_DOUBLEFP)
set(BUILDARCH "${BUILDARCH}d")
elseif(XASH_RISCV_SINGLEFP)
set(BUILDARCH "${BUILDARCH}f")
endif()
elseif(XASH_JS)
set(BUILDARCH "javascript")
elseif(XASH_E2K)

View File

@ -19,6 +19,8 @@ int main(int argc, char** argv)
}
'''
# generated(see comments in public/build.h)
# cat build.h | grep '^#undef XASH' | awk '{ print "'\''" $2 "'\''," }'
DEFINES = [
'XASH_64BIT',
'XASH_AMD64',
@ -34,9 +36,11 @@ DEFINES = [
'XASH_ARMv8',
'XASH_BIG_ENDIAN',
'XASH_BSD',
'XASH_DOS4GW',
'XASH_E2K',
'XASH_EMSCRIPTEN',
'XASH_FREEBSD',
'XASH_HAIKU',
'XASH_IOS',
'XASH_JS',
'XASH_LINUX',
@ -47,12 +51,14 @@ DEFINES = [
'XASH_MSVC',
'XASH_NETBSD',
'XASH_OPENBSD',
'XASH_HAIKU',
'XASH_POSIX',
'XASH_RISCV',
'XASH_RISCV_DOUBLEFP',
'XASH_RISCV_SINGLEFP',
'XASH_RISCV_SOFTFP',
'XASH_WIN32',
'XASH_WIN64',
'XASH_X86',
'XASH_DOS4GW',
'XASH_POSIX'
]
def configure(conf):
@ -111,10 +117,23 @@ def configure(conf):
buildarch += "hf"
else:
buildarch += "l"
elif conf.env.XASH_MIPS and conf.env.XASH_BIG_ENDIAN:
elif conf.env.XASH_MIPS:
buildarch = "mips"
elif conf.env.XASH_MIPS and conf.env.XASH_LITTLE_ENDIAN:
buildarch = "mipsel"
if conf.env.XASH_64BIT:
buildarch += "64"
if conf.env.XASH_LITTLE_ENDIAN:
buildarch += "el"
elif conf.env.XASH_RISCV:
buildarch = "riscv"
if conf.env.XASH_64BIT:
buildarch += "64"
else:
buildarch += "32"
if conf.env.XASH_RISCV_DOUBLEFP:
buildarch += "d"
elif conf.env.XASH_RISCV_SINGLEFP:
buildarch += "f"
elif conf.env.XASH_JS:
buildarch = "javascript"
elif conf.env.XASH_E2K: