From c8c2841ab9471da8a33fb83c29f133fcadfa692b Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sat, 9 Jul 2022 23:35:57 +0300 Subject: [PATCH] Build with GoldSource input by default on Windows and Linux (#264) --- .github/workflows/.github.yml | 21 ++++++++------------- CMakeLists.txt | 3 ++- appveyor.yml | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/.github.yml b/.github/workflows/.github.yml index 2795f59e..8a9d50a4 100644 --- a/.github/workflows/.github.yml +++ b/.github/workflows/.github.yml @@ -49,21 +49,16 @@ jobs: ./steam-runtime/setup_chroot.sh --i386 --tarball ./com.valvesoftware.SteamRuntime.Sdk-i386-scout-sysroot.tar.gz sudo sed -i 's/groups=sudo/groups=adm/g' /etc/schroot/chroot.d/steamrt_scout_i386.conf - - name: Build with xash3d-fwgs input + - name: Build on Linux if: startsWith(matrix.os, 'ubuntu') run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build-fwgs -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" - schroot --chroot steamrt_scout_i386 -- cmake --build build-fwgs --target all - - name: Build with goldsource input - if: startsWith(matrix.os, 'ubuntu') - run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist" + schroot --chroot steamrt_scout_i386 -- cmake -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 with goldsource input and vgui + - name: Build on Linux with vgui if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.cc, 'gcc') run: | - schroot --chroot steamrt_scout_i386 -- cmake -B build-vgui -S . -DCMAKE_EXE_LINKER_FLAGS="-Wl,--no-undefined" -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="$PWD/dist-vgui" + schroot --chroot steamrt_scout_i386 -- cmake -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 schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target all schroot --chroot steamrt_scout_i386 -- cmake --build build-vgui --target install @@ -78,15 +73,15 @@ jobs: - name: Add msbuild to PATH if: startsWith(matrix.os, 'windows') uses: microsoft/setup-msbuild@v1.0.2 - - name: Build with msvc + - name: Build on Windows if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DCMAKE_INSTALL_PREFIX="dist" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - - name: Build with msvc and vgui + - name: Build on Windows with vgui if: startsWith(matrix.os, 'windows') run: | - cmake -G "Visual Studio 16 2019" -A Win32 -B build -DGOLDSOURCE_SUPPORT=ON -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" + cmake -G "Visual Studio 16 2019" -A Win32 -B build -DUSE_VGUI=ON -DCMAKE_INSTALL_PREFIX="dist-vgui" msbuild -verbosity:normal /property:Configuration=Release build/INSTALL.vcxproj - name: Extract branch name diff --git a/CMakeLists.txt b/CMakeLists.txt index 489b84de..75372379 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,6 @@ option(USE_NOVGUI_SCOREBOARD "Prefer non-VGUI Scoreboard when USE_VGUI is enable option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) -option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") @@ -53,8 +52,10 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64"))) option(64BIT "Disable auto -m32 appending to compiler flags" OFF) + option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" ON) else() option(64BIT "Disable auto -m32 appending to compiler flags" ON) + option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF) endif() option(BARNACLE_FIX_VISIBILITY "Enable barnacle tongue length fix" OFF) diff --git a/appveyor.yml b/appveyor.yml index 6616ee57..75269482 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ configuration: before_build: - git submodule update --init --recursive - - cmake -G "%GENERATOR_NAME%" -B build -DGOLDSOURCE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX="dist" + - cmake -G "%GENERATOR_NAME%" -B build -DCMAKE_INSTALL_PREFIX="dist" artifacts: - path: dist