From acf40caafaf812f17a283e9b80c9db7708239800 Mon Sep 17 00:00:00 2001 From: Kyle Date: Sun, 30 Oct 2022 17:36:11 +0800 Subject: [PATCH] Fix github action --- .github/workflows/build.yml | 36 +++++++++++++++++++++++++++--------- AMBuildScript | 4 ++-- AMBuilder | 1 + 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9df9309..3ffeeee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,26 +13,30 @@ jobs: strategy: fail-fast: false matrix: - os: - - ubuntu-18.04 - - windows-latest + os: [ubuntu-latest, windows-latest] include: - - os: ubuntu-18.04 + - os: ubuntu-latest os_short: linux - os: windows-latest os_short: windows steps: - - name: Setup Python 3.8 + - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: 3.9 + + - name: Checkout AMBuild + uses: actions/checkout@v2 + with: + repository: alliedmodders/ambuild + path: ambuild - name: Install AMBuild - run: | - python -m pip install --upgrade pip setuptools wheel - pip install git+https://github.com/alliedmodders/ambuild + uses: BSFishy/pip-action@v1 + with: + packages: ./ambuild - name: Install dependencies (Linux) if: runner.os == 'Linux' @@ -49,6 +53,20 @@ jobs: clang --version clang++ --version + - name: Find Visual C++ compilers and make all environment variables global (Windows) + if: runner.os == 'Windows' + shell: cmd + run: | + :: See https://github.com/microsoft/vswhere/wiki/Find-VC + for /f "usebackq delims=*" %%i in (`vswhere -latest -property installationPath`) do ( + call "%%i"\Common7\Tools\vsdevcmd.bat -arch=x86 -host_arch=x64 + ) + + :: Loop over all environment variables and make them global. + for /f "delims== tokens=1,2" %%a in ('set') do ( + echo>>"%GITHUB_ENV%" %%a=%%b + ) + - name: Checkout MetaMod uses: actions/checkout@v2 with: diff --git a/AMBuildScript b/AMBuildScript index 08c9d56..50390b5 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -178,13 +178,13 @@ class ExtensionConfig(object): '-fvisibility=hidden', ] cxx.cxxflags += [ - '-std=c++11', + '-std=c++14', '-fno-exceptions', '-fno-threadsafe-statics', '-Wno-non-virtual-dtor', '-Wno-overloaded-virtual', + '-Wno-null-dereference', '-fvisibility-inlines-hidden', - '-fpermissive', ] cxx.linkflags += ['-m32'] diff --git a/AMBuilder b/AMBuilder index d2385d4..bcdc982 100644 --- a/AMBuilder +++ b/AMBuilder @@ -33,6 +33,7 @@ for sdk_name in Extension.sdks: elif sys.platform == 'linux' or sys.platform == 'linux2': binary.compiler.cxxflags += [ '-std=c++14' ] binary.compiler.cxxflags += [ '-Wno-class-memaccess' ] + binary.compiler.cxxflags += [ '-Wno-class-varargs' ] binary.compiler.cxxflags += [ '-include', 'mathlib/mathlib.h' ] Extension.extensions = builder.Add(project)