Skip to content

Commit 3d90130

Browse files
authored
Merge pull request #1497 from Return-To-The-Roots/clang-13-compat
Add support for Clang 13 and fix ordering of tools by AI
2 parents 3420c8e + 5bc1f78 commit 3d90130

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

.github/workflows/unit-tests.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
- { compiler: gcc-11, os: ubuntu-20.04, buildType: Debug, cxxStandard: 17 }
3434
- { compiler: gcc-11, os: ubuntu-20.04, buildType: Release }
3535
# Latest Clang with externals
36-
- { compiler: clang-12, os: ubuntu-20.04, buildType: Debug, cxxStandard: 14, externalSanitizer: true }
37-
- { compiler: clang-12, os: ubuntu-20.04, buildType: Debug, cxxStandard: 17 }
38-
- { compiler: clang-12, os: ubuntu-20.04, buildType: Release }
36+
- { compiler: clang-13, os: ubuntu-20.04, buildType: Debug, cxxStandard: 14, externalSanitizer: true }
37+
- { compiler: clang-13, os: ubuntu-20.04, buildType: Debug, cxxStandard: 17 }
38+
- { compiler: clang-13, os: ubuntu-20.04, buildType: Release }
3939
# Latest Clang with latest boost
40-
- { compiler: clang-12, os: ubuntu-20.04, buildType: Debug, boostVersion: 1.77.0, externalSanitizer: true }
40+
- { compiler: clang-13, os: ubuntu-20.04, buildType: Debug, boostVersion: 1.78.0, externalSanitizer: true }
4141

4242
runs-on: ${{matrix.os}}
4343

@@ -65,6 +65,12 @@ jobs:
6565
path: ${{env.DEPS_DIR}}
6666
key: ${{matrix.os}}-${{env.BOOST_VERSION}}
6767

68+
- name: Add LLVM repo
69+
if: matrix.compiler == 'clang-13' && matrix.os == 'ubuntu-20.04'
70+
run: |
71+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
72+
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
73+
sudo apt update
6874
- name: Install Compiler
6975
if: "!startsWith(runner.os, 'macos')"
7076
run: |

libs/common/include/Point.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ struct Point //-V690
2424
T x, y;
2525
constexpr Point() noexcept : x(getInvalidValue()), y(getInvalidValue()) {}
2626
constexpr Point(const T x, const T y) noexcept : x(x), y(y) {}
27-
constexpr Point(const Point&) = default;
2827
template<typename U>
2928
constexpr explicit Point(const Point<U>& pt) noexcept : x(static_cast<T>(pt.x)), y(static_cast<T>(pt.y))
3029
{}
30+
constexpr Point(const Point&) = default;
31+
constexpr Point& operator=(const Point&) = default;
3132

3233
static constexpr Point Invalid() noexcept { return Point(); }
3334
/// Create a new point with all coordinates set to value

libs/s25main/ai/aijh/AIPlayerJH.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@ void AIPlayerJH::AdjustSettings()
23712371
const unsigned requiredTools = numBuildingsRequiringWorker - inventory[job];
23722372
// When we are missing tools produce some.
23732373
// Slightly higher priority if we don't have any tool at all.
2374-
if(requiredTools > inventory[good])
2374+
if(requiredTools > numToolsAvailable)
23752375
return (inventory[good] == 0) ? 4 : 2;
23762376
numToolsAvailable -= requiredTools;
23772377
}

tests/s25Main/benchmarks/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ else()
1010
FetchContent_Declare(
1111
GoogleBenchmark
1212
GIT_REPOSITORY https://github.com/google/benchmark.git
13-
GIT_TAG v1.5.3
13+
GIT_TAG v1.6.1
1414
)
1515
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "")
1616
set(BENCHMARK_ENABLE_INSTALL OFF CACHE BOOL "")

0 commit comments

Comments
 (0)