Skip to content

Commit

Permalink
Merge pull request #121 from polserver/nopchtest
Browse files Browse the repository at this point in the history
No precompiled header fix (windows)
  • Loading branch information
turleypol committed Jan 14, 2020
2 parents 2108bf4 + a0027af commit 4693744
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
chmod +x "$cmake_archive/bin/cmake" chmod +x "$cmake_archive/bin/cmake"
echo "::add-path::$Env:GITHUB_WORKSPACE/bin-build" echo "::add-path::$Env:GITHUB_WORKSPACE/bin-build"
echo "::add-path::$Env:GITHUB_WORKSPACE/$cmake_archive/bin" echo "::add-path::$Env:GITHUB_WORKSPACE/$cmake_archive/bin"
- name: Set CXX and CC - name: Set CXX and CC
shell: pwsh shell: pwsh
run: | run: |
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/buildwinnopch.yml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Build Windows no PCH

on: [push, pull_request]

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- os: "windows-latest"
cxx-compiler: cl
c-compiler: cl
compiler-version: default
build-type: Release
nopch: 1
- os: "windows-latest"
cxx-compiler: clang-cl
c-compiler: clang-cl
compiler-version: default
build-type: Release
nopch: 1

runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: Cache curl
uses: actions/cache@v1
with:
path: lib/curl-7.57.0
key: ${{ runner.os }}-${{ matrix.config.cxx-compiler }}-${{ matrix.config.compiler-version }}-curl-7.57.0

- name: Install llvm
if: matrix.config.cxx-compiler == 'clang-cl'
shell: powershell
run: |
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop install llvm --global
echo "::set-env name=PATH::$env:PATH"
- name: Set CXX and CC
shell: pwsh
run: |
$cxx_compiler = '${{ matrix.config.cxx-compiler }}'
$c_compiler = '${{ matrix.config.c-compiler }}'
$version = '${{ matrix.config.compiler-version }}'
if ($version -ne 'default') {
$cxx_compiler = "$cxx_compiler-$version"
$c_compiler = "$c_compiler-$version"
}
echo "::set-env name=CXX::$cxx_compiler"
echo "::set-env name=CC::$c_compiler"
- name: Config
run: |
cd bin-build
cmake .. -G Ninja -DNO_PCH=${{ matrix.config.nopch }} -DCMAKE_BUILD_TYPE=${{ matrix.config.build-type }}
- name: Build
run: |
cd bin-build
cmake --build . --config ${{ matrix.config.build-type }} -- -j 2
notify_on_failure:
needs: build
runs-on: "ubuntu-latest"
if: failure()
steps:
- name: Discord notification failure
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: failure
job: Building (Windows no PCH)
nofail: false
notify_on_success:
needs: build
runs-on: "ubuntu-latest"
if: success()
steps:
- name: Discord notification success
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: success
job: Building (Windows no PCH)
nofail: false
notify_on_cancel:
needs: build
runs-on: "ubuntu-latest"
if: cancelled()
steps:
- name: Discord notification cancelled
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: turleypol/actions-status-discord@master
with:
status: cancelled
job: Building (Windows no PCH)
nofail: false
2 changes: 1 addition & 1 deletion lib/StackWalker/StackWalker.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ typedef struct IMAGEHLP_MODULE64_V2 {
return FALSE; return FALSE;
} }


hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof HMODULE)); hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof (HMODULE)));
tt = (char*) malloc(sizeof(char) * TTBUFLEN); tt = (char*) malloc(sizeof(char) * TTBUFLEN);
tt2 = (char*) malloc(sizeof(char) * TTBUFLEN); tt2 = (char*) malloc(sizeof(char) * TTBUFLEN);
if ( (hMods == NULL) || (tt == NULL) || (tt2 == NULL) ) if ( (hMods == NULL) || (tt == NULL) || (tt2 == NULL) )
Expand Down
8 changes: 5 additions & 3 deletions pol-core/clib/cfgsect.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "cfgelem.h" #include "cfgelem.h"
#include "cfgfile.h" #include "cfgfile.h"


#include <stdexcept>

namespace Pol namespace Pol
{ {
namespace Clib namespace Clib
Expand All @@ -19,7 +21,7 @@ ConfigSection::ConfigSection( ConfigFile& cf, const std::string& sectname, unsig
_cf.allowed_types_.insert( sectname.c_str() ); _cf.allowed_types_.insert( sectname.c_str() );
} }


ConfigSection::~ConfigSection() noexcept(false) ConfigSection::~ConfigSection() noexcept( false )
{ {
if ( !_found && ( _flags & CST_MANDATORY ) ) if ( !_found && ( _flags & CST_MANDATORY ) )
{ {
Expand All @@ -45,5 +47,5 @@ bool ConfigSection::matches( const ConfigElem& elem )
return false; return false;
} }
} }
} } // namespace Clib
} } // namespace Pol
1 change: 1 addition & 0 deletions pol-core/clib/network/wnsckt.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@


#include "wnsckt.h" #include "wnsckt.h"


#include <array>
#include <algorithm> #include <algorithm>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
Expand Down

0 comments on commit 4693744

Please sign in to comment.