Browse Source

Add PowerPC to library naming scheme

fix-cwd-path
Alibek Omarov 1 year ago
parent
commit
f0f4e55c48
  1. 10
      cmake/LibraryNaming.cmake
  2. 13
      public/build.h
  3. 7
      scripts/waifulib/library_naming.py

10
cmake/LibraryNaming.cmake

@ -59,6 +59,7 @@ check_group_build_target(XASH_X86 XASH_ARCHITECTURE)
check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE) check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE)
check_group_build_target(XASH_ARM XASH_ARCHITECTURE) check_group_build_target(XASH_ARM XASH_ARCHITECTURE)
check_group_build_target(XASH_MIPS XASH_ARCHITECTURE) check_group_build_target(XASH_MIPS XASH_ARCHITECTURE)
check_group_build_target(XASH_PPC XASH_ARCHITECTURE)
check_group_build_target(XASH_JS XASH_ARCHITECTURE) check_group_build_target(XASH_JS XASH_ARCHITECTURE)
check_group_build_target(XASH_E2K XASH_ARCHITECTURE) check_group_build_target(XASH_E2K XASH_ARCHITECTURE)
check_group_build_target(XASH_RISCV XASH_ARCHITECTURE) check_group_build_target(XASH_RISCV XASH_ARCHITECTURE)
@ -168,6 +169,15 @@ elseif(XASH_JS)
set(BUILDARCH "javascript") set(BUILDARCH "javascript")
elseif(XASH_E2K) elseif(XASH_E2K)
set(BUILDARCH "e2k") set(BUILDARCH "e2k")
elseif(XASH_PPC)
set(BUILDARCH "ppc")
if(XASH_64BIT)
set(BUILDARCH "${BUILDARCH}64")
endif()
if(XASH_LITTLE_ENDIAN)
set(BUILDARCH "${BUILDARCH}el")
endif()
else() else()
message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug") message(SEND_ERROR "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug")
endif() endif()

13
public/build.h

@ -76,6 +76,7 @@ Then you can use another oneliner to query all variables:
#undef XASH_NETBSD #undef XASH_NETBSD
#undef XASH_OPENBSD #undef XASH_OPENBSD
#undef XASH_POSIX #undef XASH_POSIX
#undef XASH_PPC
#undef XASH_RISCV #undef XASH_RISCV
#undef XASH_RISCV_DOUBLEFP #undef XASH_RISCV_DOUBLEFP
#undef XASH_RISCV_SINGLEFP #undef XASH_RISCV_SINGLEFP
@ -138,7 +139,12 @@ Then you can use another oneliner to query all variables:
#endif #endif
#endif #endif
#if XASH_ANDROID || defined XASH_IOS || defined XASH_NSWITCH || defined XASH_PSVITA // XASH_SAILFISH is special: SailfishOS by itself is a normal GNU/Linux platform
// It doesn't make sense to split it to separate platform
// but we still need XASH_MOBILE_PLATFORM for the engine.
// So this macro is defined entirely in build-system: see main wscript
// HLSDK/PrimeXT/other SDKs users note: you may ignore this macro
#if XASH_ANDROID || XASH_IOS || XASH_NSWITCH || XASH_PSVITA || XASH_SAILFISH
#define XASH_MOBILE_PLATFORM 1 #define XASH_MOBILE_PLATFORM 1
#endif #endif
@ -190,6 +196,11 @@ Then you can use another oneliner to query all variables:
#elif defined __e2k__ #elif defined __e2k__
#define XASH_64BIT 1 #define XASH_64BIT 1
#define XASH_E2K 1 #define XASH_E2K 1
#elif defined __PPC__ || defined __powerpc__
#define XASH_PPC 1
#if defined __PPC64__ || defined __powerpc64__
#define XASH_64BIT 1
#endif
#elif defined _M_ARM // msvc #elif defined _M_ARM // msvc
#define XASH_ARM 7 #define XASH_ARM 7
#define XASH_ARM_HARDFP 1 #define XASH_ARM_HARDFP 1

7
scripts/waifulib/library_naming.py

@ -51,6 +51,7 @@ DEFINES = [
'XASH_NETBSD', 'XASH_NETBSD',
'XASH_OPENBSD', 'XASH_OPENBSD',
'XASH_POSIX', 'XASH_POSIX',
'XASH_PPC',
'XASH_RISCV', 'XASH_RISCV',
'XASH_RISCV_DOUBLEFP', 'XASH_RISCV_DOUBLEFP',
'XASH_RISCV_SINGLEFP', 'XASH_RISCV_SINGLEFP',
@ -152,6 +153,12 @@ def configure(conf):
buildarch = "javascript" buildarch = "javascript"
elif conf.env.XASH_E2K: elif conf.env.XASH_E2K:
buildarch = "e2k" buildarch = "e2k"
elif conf.env.XASH_PPC:
buildarch = "ppc"
if conf.env.XASH_64BIT:
buildarch += "64"
if conf.env.XASH_LITTLE_ENDIAN:
buildarch += "el"
else: else:
raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n" raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n"
"If this is a mistake, try to fix conditions above and report a bug") "If this is a mistake, try to fix conditions above and report a bug")

Loading…
Cancel
Save