Make servers configurable from meson

This commit is contained in:
Tamás Bálint Misius 2020-12-15 22:02:56 +01:00
parent e9bed49906
commit 6ab46c20e7
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2
5 changed files with 35 additions and 3 deletions

6
.github/build.sh vendored
View File

@ -53,9 +53,15 @@ fi
if [ $PLATFORM_SHORT == "win" ]; then
bin_postfix=$bin_postfix.exe
fi
if echo $RELTYPECFG | base64 -d | grep snapshot; then
other_flags+=$'\t-Dupdate_server=starcatcher.us/TPT'
fi
meson -Dbuildtype=release -Dbuild_render=true -Dbuild_font=true -Db_pie=false -Db_staticpic=false -Db_lto=true $static_flag -Dinstall_check=true $other_flags `echo $RELTYPECFG | base64 -d` build
cd build
ninja
if [ $PLATFORM_SHORT == "lin" ] || [ $PLATFORM_SHORT == "mac" ]; then
strip powder$bin_postfix render$bin_postfix font$bin_postfix
fi
7z a ../powder.zip powder$bin_postfix render$bin_postfix font$bin_postfix
cd ..
7z a powder.zip README.md LICENSE

View File

@ -74,7 +74,7 @@ jobs:
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: powder.zip
asset_name: powder-${{ matrix.platform_short }}-${{ steps.get_type.outputs.NAME }}64.zip
asset_name: powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.platform_short }}64.zip
asset_content_type: application/zip
- uses: actions/upload-artifact@v2
if: steps.get_type.outputs.TYPE == 'dev' && matrix.static_dynamic == 'static'

View File

@ -228,6 +228,13 @@ conf_data.set('SNAPSHOT', get_option('snapshot'))
conf_data.set('SNAPSHOT_ID', get_option('snapshot_id'))
conf_data.set('FUTURE_SAVE_VERSION', get_option('future_major'))
conf_data.set('FUTURE_MINOR_VERSION', get_option('future_minor'))
conf_data.set('SERVER', '"' + get_option('server') + '"')
conf_data.set('STATICSERVER', '"' + get_option('static_server') + '"')
if get_option('update_server') != ''
conf_data.set('UPDATESERVER', '"' + get_option('update_server') + '"')
else
conf_data.set('UPDATESERVER', false)
endif
resources_files = []

View File

@ -147,3 +147,21 @@ option(
value: false,
description: 'Build the font editor'
)
option(
'server',
type: 'string',
value: 'powdertoy.co.uk',
description: 'Simulation server'
)
option(
'static_server',
type: 'string',
value: 'static.powdertoy.co.uk',
description: 'Static simulation server'
)
option(
'update_server',
type: 'string',
value: '',
description: 'Update server, only used by snapshots and mods, see \'snapshot_id\' and \'mod_id\''
)

View File

@ -21,6 +21,9 @@
#mesondefine X86_SSE2
#mesondefine X86_SSE3
#mesondefine _64BIT
#mesondefine SERVER
#mesondefine STATICSERVER
#mesondefine UPDATESERVER
#ifdef WIN
# define PATH_SEP "\\"
@ -89,9 +92,7 @@
#define MTOS(str) MTOS_EXPAND(str)
#define SCHEME "https://"
#define SERVER "powdertoy.co.uk"
#define STATICSCHEME "https://"
#define STATICSERVER "static.powdertoy.co.uk"
#define ENFORCE_HTTPS
#define LOCAL_SAVE_DIR "Saves"