diff --git a/.travis.yml b/.travis.yml index 619db4a..cdd8fbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,16 @@ language: cpp + branches: only: - master except: - /^(?i:release)-.*$/ -env: - global: - - DEPS_DIR=${HOME}/deps jobs: include: - name: Windows os: windows - python: 3.8 + python: 3.7 before_install: - choco install python --version=3.8.2 - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" @@ -34,17 +32,21 @@ jobs: script: - ./build.sh + before_deploy: - git config --local user.name "Kxnrl" - git config --local user.email "kyle@kxnrl.com" - export TRAVIS_TAG=release-$TRAVIS_OS_NAME-$TRAVIS_BUILD_NUMBER - git tag $TRAVIS_TAG + deploy: provider: releases api_key: $token file: - build/package/addons/sourcemod/extensions/TransmitManager.ext.2.csgo.dll - build/package/addons/sourcemod/extensions/TransmitManager.ext.2.csgo.so + - build/package/addons/sourcemod/extensions/TransmitManager.ext.2.insurgency.dll + - build/package/addons/sourcemod/extensions/TransmitManager.ext.2.insurgency.so - build/package/addons/sourcemod/scripting/include/TransmitManager.inc on: repo: Kxnrl/sm-ext-TransmitManager diff --git a/AMBuildScript b/AMBuildScript index 1538dcb..08c9d56 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -184,6 +184,7 @@ class ExtensionConfig(object): '-Wno-non-virtual-dtor', '-Wno-overloaded-virtual', '-fvisibility-inlines-hidden', + '-fpermissive', ] cxx.linkflags += ['-m32'] diff --git a/build.bat b/build.bat index 0331f60..91b5841 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,10 @@ -set EXT_DIR="%cd%" +echo "Set environment" +set EXT_DIR=%cd% +set DEP_DIR=%EXT_DIR%\build-windows set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" +mkdir "%DEP_DIR%" + +cd %DEP_DIR% if "%VSCMD_VER%"=="" ( set MAKE= @@ -8,15 +13,45 @@ if "%VSCMD_VER%"=="" ( call %VCVARSALL% x86 ) -git clone https://github.com/alliedmodders/metamod-source --branch "%MMBRANCH%" --single-branch "%EXT_DIR%/mmsource-%MMBRANCH%" -git clone https://github.com/alliedmodders/hl2sdk --branch csgo --single-branch "%EXT_DIR%/hl2sdk-csgo" -git clone https://github.com/alliedmodders/sourcemod --recursive --branch "%SMBRANCH%" --single-branch "%EXT_DIR%/sourcemod-%SMBRANCH%" - -mkdir "%EXT_DIR%/build" -pushd "%EXT_DIR%/build" -python "%EXT_DIR%/configure.py" --enable-optimize --mms-path "%EXT_DIR%/mmsource-%MMBRANCH%" --sm-path "%EXT_DIR%/sourcemod-%SMBRANCH%" --hl2sdk-root "%EXT_DIR%" -s csgo || goto error -ambuild || goto error +:: Install ambuild +echo "Install ambuild" +git clone https://github.com/alliedmodders/ambuild +pushd ambuild +python setup.py install popd -:error -exit /b %errorlevel% \ No newline at end of file +:: Getting sourcemod + +echo "Download sourcemod" +git clone https://github.com/alliedmodders/sourcemod --recursive --branch %SMBRANCH% --single-branch sourcemod + +pushd sourcemod +set SOURCEMOD=%cd% +popd + +:: Getting metamod + +echo "Download metamod" +git clone https://github.com/alliedmodders/metamod-source --recursive --branch %MMBRANCH% --single-branch metamod + +pushd metamod +set METAMOD=%cd% +popd + +:: Getting hl2sdk + +echo "Download hl2sdk-csgo" +git clone https://github.com/alliedmodders/hl2sdk --recursive --branch csgo --single-branch hl2sdk-csgo +echo "Download hl2sdk-insurgency" +git clone https://github.com/alliedmodders/hl2sdk --recursive --branch insurgency --single-branch hl2sdk-insurgency + +:: Start build + +echo "Build" +cd %EXT_DIR% + +mkdir build +pushd build +python "%EXT_DIR%/configure.py" --enable-optimize --sm-path "%SOURCEMOD%" --mms-path "%METAMOD%" --hl2sdk-root "%DEP_DIR%" --sdks=csgo,insurgency +ambuild || exit /b %errorlevel% +popd diff --git a/build.sh b/build.sh index 4d47b7b..d01c380 100644 --- a/build.sh +++ b/build.sh @@ -1,19 +1,30 @@ #!/bin/bash +sudo apt-get update +sudo apt-get install -y gcc-multilib g++-multilib + set -e EXT_DIR=$(pwd) -git clone https://github.com/alliedmodders/metamod-source --branch "$MMBRANCH" --single-branch "$EXT_DIR/mmsource-$MMBRANCH" -git clone https://github.com/alliedmodders/hl2sdk --branch csgo --single-branch "$EXT_DIR/hl2sdk-csgo" -git clone https://github.com/alliedmodders/sourcemod --recursive --branch "$SMBRANCH" --single-branch "$EXT_DIR/sourcemod-$SMBRANCH" +#clone ambuild +echo "Installing ambuild ..." +git clone https://github.com/alliedmodders/ambuild $HOME/ambuild +pushd $HOME/ambuild +sudo python setup.py install +popd +#clone sourcemod / metamod / hl2sdk +echo "Installing Sourcemod/Metamod/HL2SDK ..." +git clone https://github.com/alliedmodders/sourcemod --recursive --branch $SMBRANCH --single-branch "$EXT_DIR/sourcemod" +git clone https://github.com/alliedmodders/metamod-source --recursive --branch $MMBRANCH --single-branch "$EXT_DIR/metamod" +git clone https://github.com/alliedmodders/hl2sdk --recursive --branch csgo --single-branch "$EXT_DIR/hl2sdk-csgo" +git clone https://github.com/alliedmodders/hl2sdk --recursive --branch insurgency --single-branch "$EXT_DIR/hl2sdk-insurgency" + +#build mkdir -p "$EXT_DIR/build" pushd "$EXT_DIR/build" -python3 "$EXT_DIR/configure.py" --enable-optimize --mms-path "$EXT_DIR/mmsource-$MMBRANCH" --sm-path "$EXT_DIR/sourcemod-$SMBRANCH" --hl2sdk-root "$EXT_DIR" -s csgo +#CC=clang CXX=clang++ +python "$EXT_DIR/configure.py" --enable-optimize --sm-path "$EXT_DIR/sourcemod" --mms-path "$EXT_DIR/metamod" --hl2sdk-root "$EXT_DIR" --sdks=csgo,insurgency ambuild - -# might be optional -strip package/addons/sourcemod/extensions/TransmitManager.ext.2.csgo.so - popd \ No newline at end of file