Skip to content

Commit 82f85a4

Browse files
committed
Add WebAssembly and Solaris definitions from engine
1 parent 852fc5a commit 82f85a4

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

cmake/LibraryNaming.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ check_group_build_target(XASH_SERENITY XASH_PLATFORM)
5454
check_group_build_target(XASH_IRIX XASH_PLATFORM)
5555
check_group_build_target(XASH_NSWITCH XASH_PLATFORM)
5656
check_group_build_target(XASH_PSVITA XASH_PLATFORM)
57+
check_group_build_target(XASH_WASI XASH_PLATFORM)
58+
check_group_build_target(XASH_SUNOS XASH_PLATFORM)
5759
check_group_build_target(XASH_X86 XASH_ARCHITECTURE)
5860
check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE)
5961
check_group_build_target(XASH_ARM XASH_ARCHITECTURE)
@@ -105,6 +107,10 @@ elseif(XASH_PSVITA)
105107
set(BUILDOS "psvita")
106108
elseif(XASH_IRIX)
107109
set(BUILDOS "irix")
110+
elseif(XASH_WASI)
111+
set(BUILDOS "wasi")
112+
elseif(XASH_SUNOS)
113+
set(BUILDOS "sunos")
108114
else()
109115
message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug")
110116
endif()

public/build.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,13 @@ Then you can use another oneliner to query all variables:
8181
#undef XASH_RISCV_SINGLEFP
8282
#undef XASH_RISCV_SOFTFP
8383
#undef XASH_SERENITY
84+
#undef XASH_SUNOS
8485
#undef XASH_WIN32
8586
#undef XASH_X86
8687
#undef XASH_NSWITCH
8788
#undef XASH_PSVITA
89+
#undef XASH_WASI
90+
#undef XASH_WASM
8891

8992
//================================================================
9093
//
@@ -126,6 +129,10 @@ Then you can use another oneliner to query all variables:
126129
#define XASH_NSWITCH 1
127130
#elif defined __vita__
128131
#define XASH_PSVITA 1
132+
#elif defined __wasi__
133+
#define XASH_WASI 1
134+
#elif defined __sun__
135+
#define XASH_SUNOS 1
129136
#else
130137
#error
131138
#endif
@@ -234,10 +241,19 @@ Then you can use another oneliner to query all variables:
234241
#else
235242
#error "Unknown RISC-V float ABI"
236243
#endif
244+
#elif defined __wasm__
245+
#if defined __wasm64__
246+
#define XASH_64BIT 1
247+
#endif
248+
#define XASH_WASM 1
237249
#else
238250
#error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug"
239251
#endif
240252

253+
#if !XASH_64BIT && ( defined( __LP64__ ) || defined( _LP64 ))
254+
#define XASH_64BIT 1
255+
#endif
256+
241257
#if XASH_ARM == 8
242258
#define XASH_ARMv8 1
243259
#elif XASH_ARM == 7

scripts/waifulib/library_naming.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
'XASH_X86',
6161
'XASH_NSWITCH',
6262
'XASH_PSVITA',
63+
'XASH_WASI',
64+
'XASH_SUNOS',
6365
]
6466

6567
def configure(conf):
@@ -97,6 +99,10 @@ def configure(conf):
9799
buildos = "psvita"
98100
elif conf.env.XASH_IRIX:
99101
buildos = "irix"
102+
elif conf.env.XASH_WASI:
103+
buildos = "wasi"
104+
elif conf.env.XASH_SUNOS:
105+
buildos = "sunos"
100106
else:
101107
conf.fatal("Place your operating system name in build.h and library_naming.py!\n"
102108
"If this is a mistake, try to fix conditions above and report a bug")

0 commit comments

Comments
 (0)