Skip to content

Commit

Permalink
Merge branch 'master' into bshift
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Nov 23, 2024
2 parents e65739b + 5a6e0e0 commit e0b2405
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 24 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
STEAMRT_SNAPSHOT: latest-steam-client-general-availability
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,10 +39,10 @@ jobs:
uses: actions/cache@v4
with:
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
key: ${{ runner.os }}-steam-runtime
key: steam-runtime-${{ env.STEAMRT_SNAPSHOT }}
- name: Download steam-runtime
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/${{ env.STEAMRT_SNAPSHOT }}/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
- name: Install steam runtime
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand All @@ -52,14 +53,15 @@ jobs:
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DPOLLY=ON -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_INSTALL_PREFIX="$PWD/dist"
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
- name: Build on Linux with vgui
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -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"
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"
cp vgui_support/vgui-dev/lib/vgui.so build-vgui/cl_dll
cp vgui_support/vgui-dev/lib/vgui.so build-vgui
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
options:
- 'OFF'
- 'ON'
steamrt_snapshot:
type: string
description: SteamRT Snapshot
default: 'latest-steam-client-general-availability'
jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -48,10 +52,10 @@ jobs:
uses: actions/cache@v4
with:
path: com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
key: ${{ runner.os }}-steam-runtime
key: steam-runtime-${{ github.event.inputs.steamrt_snapshot }}
- name: Download steam-runtime
if: startsWith(matrix.os, 'ubuntu') && steps.cache-steam-runtime.outputs.cache-hit != 'true'
run: wget --no-verbose https://repo.steampowered.com/steamrt-images-scout/snapshots/0.20210610.0/com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz
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
- name: Install steam runtime
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand All @@ -64,10 +68,11 @@ jobs:
run: |
mkdir -p build/cl_dll
cp vgui_support/vgui-dev/lib/vgui.so build/cl_dll
cp vgui_support/vgui-dev/lib/vgui.so build
- name: Build on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
schroot --chroot steamrt_scout_i386 -- cmake -GNinja -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DCMAKE_BUILD_TYPE=${{ github.event.inputs.buildtype }} -DCMAKE_INSTALL_PREFIX="$PWD/dist" -DUSE_VGUI=${{ github.event.inputs.usevgui }}
schroot --chroot steamrt_scout_i386 -- cmake --build build --target all
schroot --chroot steamrt_scout_i386 -- cmake --build build --target install
Expand Down
6 changes: 4 additions & 2 deletions cl_dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ install( TARGETS ${CLDLL_LIBRARY}
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE )

add_custom_command(TARGET ${CLDLL_LIBRARY}
if(CMAKE_BUILD_TYPE MATCHES "Release")
add_custom_command(TARGET ${CLDLL_LIBRARY}
POST_BUILD DEPENDS ${CLDLL_LIBRARY}
COMMAND $<$<CONFIG:release>:${CMAKE_STRIP}> -s $<TARGET_FILE:${CLDLL_LIBRARY}>)
COMMAND ${CMAKE_STRIP} -s $<TARGET_FILE:${CLDLL_LIBRARY}>)
endif()
6 changes: 3 additions & 3 deletions cl_dll/hud_spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,9 +727,9 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf )
v1[1] = READ_COORD();
v1[2] = READ_COORD(); // vJumpOrigin

v1[0] = READ_COORD(); // view angle
v1[1] = READ_COORD(); // vJumpAngles
v1[2] = READ_COORD();
v2[0] = READ_COORD(); // view angle
v2[1] = READ_COORD(); // vJumpAngles
v2[2] = READ_COORD();

f1 = READ_BYTE(); // fov
i1 = READ_WORD(); // target
Expand Down
1 change: 1 addition & 0 deletions cl_dll/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def options(opt):
opt.load('vgui')

def configure(conf):
conf.options.VGUI_DEV = os.path.join('vgui_support', 'vgui-dev') # vgui is in submodule
conf.env.USE_VGUI = conf.options.USE_VGUI
conf.env.USE_NOVGUI_MOTD = conf.options.USE_NOVGUI_MOTD
conf.env.USE_NOVGUI_SCOREBOARD = conf.options.USE_NOVGUI_SCOREBOARD
Expand Down
6 changes: 6 additions & 0 deletions cmake/LibraryNaming.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ check_group_build_target(XASH_SERENITY XASH_PLATFORM)
check_group_build_target(XASH_IRIX XASH_PLATFORM)
check_group_build_target(XASH_NSWITCH XASH_PLATFORM)
check_group_build_target(XASH_PSVITA XASH_PLATFORM)
check_group_build_target(XASH_WASI XASH_PLATFORM)
check_group_build_target(XASH_SUNOS XASH_PLATFORM)
check_group_build_target(XASH_X86 XASH_ARCHITECTURE)
check_group_build_target(XASH_AMD64 XASH_ARCHITECTURE)
check_group_build_target(XASH_ARM XASH_ARCHITECTURE)
Expand Down Expand Up @@ -105,6 +107,10 @@ elseif(XASH_PSVITA)
set(BUILDOS "psvita")
elseif(XASH_IRIX)
set(BUILDOS "irix")
elseif(XASH_WASI)
set(BUILDOS "wasi")
elseif(XASH_SUNOS)
set(BUILDOS "sunos")
else()
message(SEND_ERROR "Place your operating system name here! If this is a mistake, try to fix conditions above and report a bug")
endif()
Expand Down
6 changes: 4 additions & 2 deletions dlls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ install( TARGETS ${SVDLL_LIBRARY}
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE)

add_custom_command(TARGET ${SVDLL_LIBRARY}
if(CMAKE_BUILD_TYPE MATCHES "Release")
add_custom_command(TARGET ${SVDLL_LIBRARY}
POST_BUILD DEPENDS ${SVDLL_LIBRARY}
COMMAND $<$<CONFIG:release>:${CMAKE_STRIP}> -s $<TARGET_FILE:${SVDLL_LIBRARY}>)
COMMAND ${CMAKE_STRIP} -s $<TARGET_FILE:${SVDLL_LIBRARY}>)
endif()
2 changes: 1 addition & 1 deletion dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "vcs_info.h"

static cvar_t build_commit = { "sv_game_build_commit", g_VCSInfo_Commit };
static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Commit };
static cvar_t build_branch = { "sv_game_build_branch", g_VCSInfo_Branch };

cvar_t displaysoundlist = {"displaysoundlist","0"};

Expand Down
16 changes: 16 additions & 0 deletions public/build.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ Then you can use another oneliner to query all variables:
#undef XASH_RISCV_SINGLEFP
#undef XASH_RISCV_SOFTFP
#undef XASH_SERENITY
#undef XASH_SUNOS
#undef XASH_WIN32
#undef XASH_X86
#undef XASH_NSWITCH
#undef XASH_PSVITA
#undef XASH_WASI
#undef XASH_WASM

//================================================================
//
Expand Down Expand Up @@ -126,6 +129,10 @@ Then you can use another oneliner to query all variables:
#define XASH_NSWITCH 1
#elif defined __vita__
#define XASH_PSVITA 1
#elif defined __wasi__
#define XASH_WASI 1
#elif defined __sun__
#define XASH_SUNOS 1
#else
#error
#endif
Expand Down Expand Up @@ -234,10 +241,19 @@ Then you can use another oneliner to query all variables:
#else
#error "Unknown RISC-V float ABI"
#endif
#elif defined __wasm__
#if defined __wasm64__
#define XASH_64BIT 1
#endif
#define XASH_WASM 1
#else
#error "Place your architecture name here! If this is a mistake, try to fix conditions above and report a bug"
#endif

#if !XASH_64BIT && ( defined( __LP64__ ) || defined( _LP64 ))
#define XASH_64BIT 1
#endif

#if XASH_ARM == 8
#define XASH_ARMv8 1
#elif XASH_ARM == 7
Expand Down
27 changes: 21 additions & 6 deletions scripts/waifulib/library_naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
'XASH_X86',
'XASH_NSWITCH',
'XASH_PSVITA',
'XASH_WASI',
'XASH_SUNOS',
]

def configure(conf):
Expand All @@ -75,8 +77,12 @@ def configure(conf):
# engine/common/build.c
if conf.env.XASH_ANDROID:
buildos = "android"
elif conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE:
buildos = "" # no prefix for default OS
elif conf.env.XASH_WIN32:
buildos = "win32"
elif conf.env.XASH_LINUX:
buildos = "linux"
elif conf.env.XASH_APPLE:
buildos = "apple"
elif conf.env.XASH_FREEBSD:
buildos = "freebsd"
elif conf.env.XASH_NETBSD:
Expand All @@ -97,17 +103,18 @@ def configure(conf):
buildos = "psvita"
elif conf.env.XASH_IRIX:
buildos = "irix"
elif conf.env.XASH_WASI:
buildos = "wasi"
elif conf.env.XASH_SUNOS:
buildos = "sunos"
else:
conf.fatal("Place your operating system name in build.h and library_naming.py!\n"
"If this is a mistake, try to fix conditions above and report a bug")

if conf.env.XASH_AMD64:
buildarch = "amd64"
elif conf.env.XASH_X86:
if conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE:
buildarch = ""
else:
buildarch = "i386"
buildarch = "i386"
elif conf.env.XASH_ARM and conf.env.XASH_64BIT:
buildarch = "arm64"
elif conf.env.XASH_ARM:
Expand Down Expand Up @@ -160,6 +167,14 @@ def configure(conf):
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")

node = conf.bldnode.make_node('true_postfix.txt')
node.write('%s-%s' % (buildos, buildarch))

if not conf.env.XASH_ANDROID and (conf.env.XASH_WIN32 or conf.env.XASH_LINUX or conf.env.XASH_APPLE):
buildos = ''
if conf.env.XASH_X86:
buildarch = ''

conf.env.revert()

if buildos == 'android':
Expand Down
5 changes: 2 additions & 3 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def configure(conf):
conf.env.MSVC_SUBSYSTEM = 'WINDOWS'

# Load compilers early
conf.load('xcompile compiler_c compiler_cxx')
conf.load('xcompile compiler_c compiler_cxx gccdeps')

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

enforce_pic = True # modern defaults
conf.check_pic(enforce_pic)
conf.check_pic(True) # modern defaults

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

0 comments on commit e0b2405

Please sign in to comment.