Skip to content

Commit 291a401

Browse files
committed
Merge branch 'master' into mobile_hacks
2 parents 3bc2ecb + 5a6e0e0 commit 291a401

File tree

7 files changed

+57
-13
lines changed

7 files changed

+57
-13
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
env:
2121
CC: ${{ matrix.cc }}
2222
CXX: ${{ matrix.cxx }}
23+
STEAMRT_SNAPSHOT: latest-steam-client-general-availability
2324
steps:
2425
- name: Checkout
2526
uses: actions/checkout@v4
@@ -38,10 +39,10 @@ jobs:
3839
uses: actions/cache@v4
3940
with:
4041
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
41-
key: ${{ runner.os }}-steam-runtime
42+
key: steam-runtime-${{ env.STEAMRT_SNAPSHOT }}
4243
- name: Download steam-runtime
4344
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
44-
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
45+
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ env.STEAMRT_SNAPSHOT }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
4546
- name: Install steam runtime
4647
if: startsWith(matrix.os, 'ubuntu')
4748
run: |
@@ -60,6 +61,7 @@ jobs:
6061
run: |
6162
schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui"
6263
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
64+
cp vgui_support/vgui-dev/lib/vgui.so build-vgui
6365
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
6466
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
6567

.github/workflows/manual.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
options:
1616
- 'OFF'
1717
- 'ON'
18+
steamrt_snapshot:
19+
type: string
20+
description: SteamRT Snapshot
21+
default: 'latest-steam-client-general-availability'
1822
jobs:
1923
build:
2024
runs-on: ${{ matrix.os }}
@@ -48,10 +52,10 @@ jobs:
4852
uses: actions/cache@v4
4953
with:
5054
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
51-
key: ${{ runner.os }}-steam-runtime
55+
key: steam-runtime-${{ github.event.inputs.steamrt_snapshot }}
5256
- name: Download steam-runtime
5357
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
54-
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
58+
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ github.event.inputs.steamrt_snapshot }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
5559
- name: Install steam runtime
5660
if: startsWith(matrix.os, 'ubuntu')
5761
run: |
@@ -64,6 +68,7 @@ jobs:
6468
run: |
6569
mkdir -p build/cl_dll
6670
cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll
71+
cp vgui_support/vgui-dev/lib/vgui.so build
6772
- name: Build on Linux
6873
if: startsWith(matrix.os, 'ubuntu')
6974
run: |

cl_dll/wscript

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def options(opt):
2020
opt.load('vgui')
2121

2222
def configure(conf):
23+
conf.options.VGUI_DEV = os.path.join('vgui_support', 'vgui-dev') # vgui is in submodule
2324
conf.env.USE_VGUI = conf.options.USE_VGUI
2425
conf.env.USE_NOVGUI_MOTD = conf.options.USE_NOVGUI_MOTD
2526
conf.env.USE_NOVGUI_SCOREBOARD = conf.options.USE_NOVGUI_SCOREBOARD

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: 21 additions & 6 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):
@@ -75,8 +77,12 @@ def configure(conf):
7577
# engine/common/build.c
7678
if conf.env.XASH_ANDROID:
7779
buildos = "android"
78-
elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE:
79-
buildos = "" # no prefix for default OS
80+
elif conf.env.XASH_WIN32:
81+
buildos = "win32"
82+
elif conf.env.XASH_LINUX:
83+
buildos = "linux"
84+
elif conf.env.XASH_APPLE:
85+
buildos = "apple"
8086
elif conf.env.XASH_FREEBSD:
8187
buildos = "freebsd"
8288
elif conf.env.XASH_NETBSD:
@@ -97,17 +103,18 @@ def configure(conf):
97103
buildos = "psvita"
98104
elif conf.env.XASH_IRIX:
99105
buildos = "irix"
106+
elif conf.env.XASH_WASI:
107+
buildos = "wasi"
108+
elif conf.env.XASH_SUNOS:
109+
buildos = "sunos"
100110
else:
101111
conf.fatal("Place your operating system name in build.h and library_naming.py!\n"
102112
"If this is a mistake, try to fix conditions above and report a bug")
103113

104114
if conf.env.XASH_AMD64:
105115
buildarch = "amd64"
106116
elif conf.env.XASH_X86:
107-
if conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE:
108-
buildarch = ""
109-
else:
110-
buildarch = "i386"
117+
buildarch = "i386"
111118
elif conf.env.XASH_ARM and conf.env.XASH_64BIT:
112119
buildarch = "arm64"
113120
elif conf.env.XASH_ARM:
@@ -160,6 +167,14 @@ def configure(conf):
160167
raise conf.fatal("Place your architecture name in build.h and library_naming.py!\n"
161168
"If this is a mistake, try to fix conditions above and report a bug")
162169

170+
node = conf.bldnode.make_node('true_postfix.txt')
171+
node.write('%s-%s' % (buildos, buildarch))
172+
173+
if not conf.env.XASH_ANDROID and (conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE):
174+
buildos = ''
175+
if conf.env.XASH_X86:
176+
buildarch = ''
177+
163178
conf.env.revert()
164179

165180
if buildos == 'android':

wscript

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def configure(conf):
4848
conf.env.MSVC_SUBSYSTEM = 'WINDOWS'
4949

5050
# Load compilers early
51-
conf.load('xcompile compiler_c compiler_cxx')
51+
conf.load('xcompile compiler_c compiler_cxx gccdeps')
5252

5353
# HACKHACK: override msvc DEST_CPU value by something that we understand
5454
if conf.env.DEST_CPU == 'amd64':
@@ -63,8 +63,7 @@ def configure(conf):
6363
if conf.env.GIT_BRANCH:
6464
conf.define('XASH_BUILD_BRANCH', conf.env.GIT_BRANCH)
6565

66-
enforce_pic = True # modern defaults
67-
conf.check_pic(enforce_pic)
66+
conf.check_pic(True) # modern defaults
6867

6968
# We restrict 64-bit builds ONLY for Win/Linux/OSX running on Intel architecture
7069
# Because compatibility with original GoldSrc

0 commit comments

Comments
 (0)