Skip to content

Commit 48960c4

Browse files
committed
use conan
1 parent cc21ddf commit 48960c4

File tree

1,077 files changed

+171
-601907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,077 files changed

+171
-601907
lines changed

.github/conan/profiles/linux-gcc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[settings]
2+
arch=x86_64
3+
build_type=Release
4+
compiler=gcc
5+
compiler.cppstd=23
6+
compiler.libcxx=libstdc++11
7+
compiler.version=14
8+
os=Linux
9+
10+
[conf]
11+
tools.build:compiler_executables={'cpp': 'g++-14', 'c': 'gcc-14'}
12+
tools.cmake.cmake_layout:build_folder_vars+=["settings.compiler"]
13+
tools.cmake.cmaketoolchain:generator=Ninja
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[settings]
2+
arch=x86_64
3+
build_type=Release
4+
compiler=clang
5+
compiler.cppstd=23
6+
compiler.runtime=dynamic
7+
compiler.runtime_type=Release
8+
compiler.runtime_version=v144
9+
compiler.version=17
10+
os=Windows
11+
openssl/*:compiler=msvc
12+
openssl/*:compiler.cppstd=17
13+
openssl/*:compiler.runtime=dynamic
14+
openssl/*:compiler.runtime_type=Release
15+
openssl/*:compiler.version=194
16+
17+
[conf]
18+
tools.cmake.cmake_layout:build_folder_vars=['settings.compiler']
19+
tools.cmake.cmaketoolchain:generator=Ninja
20+
!openssl*:tools.build:compiler_executables={'cpp': 'clang-cl', 'c': 'clang-cl'}
21+
!openssl*:tools.build:exelinkflags=['clang_rt.builtins-x86_64.lib']
22+
!openssl*:tools.build:sharedlinkflags=['clang_rt.builtins-x86_64.lib']

.github/workflows/build.yaml

Lines changed: 67 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,12 @@ on: [push]
44

55
jobs:
66
build-windows:
7-
name: Build Windows Qt${{ matrix.qt-major-version }}
8-
strategy:
9-
matrix:
10-
qt-major-version: [6, 5]
11-
include:
12-
- qt-major-version: 6
13-
qt-version: 6.7.2
14-
clang-version: 18
15-
zipfile: PotatoAlert.zip
16-
- qt-major-version: 5
17-
qt-version: 5.15.2
18-
clang-version: 17 # until Qt 5.15.2 fixes qsizepolicy.h(137,38): error : invalid bitwise operation between different enumeration types ('Policy' and 'QSizePolicy::PolicyFlag')
19-
zipfile: PotatoAlert_win7.zip
7+
name: Build Windows Qt6
8+
env:
9+
qt-major-version: 6
10+
qt-version: 6.7.2
11+
clang-version: 18
12+
zipfile: PotatoAlert.zip
2013

2114
runs-on: windows-2022
2215

@@ -29,85 +22,105 @@ jobs:
2922
with:
3023
arch: x64
3124

25+
- name: Setup Conan
26+
run: |
27+
pip install conan
28+
conan profile detect
29+
3230
- name: Setup Ninja
3331
uses: seanmiddleditch/gha-setup-ninja@v5
3432
with:
3533
version: 1.12.1
3634

37-
- name: Install Qt${{ matrix.qt-major-version }}
35+
- name: Install Qt${{ env.qt-major-version }}
3836
uses: jurplel/install-qt-action@v4
3937
with:
40-
version: ${{ matrix.qt-version }}
38+
version: ${{ env.qt-version }}
4139
cache: true
4240

4341
- name: Install LLVM and Clang
4442
uses: KyleMayes/install-llvm-action@v2
4543
with:
46-
version: ${{ matrix.clang-version }}
44+
version: ${{ env.clang-version }}
45+
46+
- name: Conan Version
47+
run: conan --version
4748

4849
- name: CMake Version
4950
run: cmake --version
5051

5152
- name: Clang Version
5253
run: clang-cl --version
5354

55+
- name: Ninja Version
56+
run: ninja --version
57+
58+
- name: Cache Conan Dependencies
59+
uses: actions/cache@v4
60+
with:
61+
path: ~/.conan2
62+
key: hashFiles('**/conanfile.py')
63+
64+
- name: Run Conan
65+
run: conan build . --build=missing --profile:all=./.github/conan/profiles/windows-clang-cl
66+
5467
- name: Run CMake
5568
env:
5669
CC: "${{ env.LLVM_PATH }}\\bin\\clang-cl"
5770
CXX: "${{ env.LLVM_PATH }}\\bin\\clang-cl"
58-
run: cmake -S . -B build -G Ninja -DCMAKE_RC_COMPILER=RC -DCMAKE_BUILD_TYPE=Release -DPA_SUBMIT_URL=${{ secrets.PA_SUBMIT_URL }} -DPA_LOOKUP_URL=${{ secrets.PA_LOOKUP_URL }}
71+
run: cmake -S . -DCMAKE_RC_COMPILER=RC -DPA_SUBMIT_URL=${{ secrets.PA_SUBMIT_URL }} -DPA_LOOKUP_URL=${{ secrets.PA_LOOKUP_URL }} --preset conan-clang-release
5972

6073
- name: Run Build
61-
run: cmake --build build --config Release --target PotatoAlert PotatoUpdater CoreTest GameFileUnpackTest GameTest ReplayTest
74+
run: cmake --build build --preset conan-clang-release --target PotatoAlert PotatoUpdater CoreTest GameFileUnpackTest GameTest ReplayTest
6275

6376
- name: Run CTest
64-
working-directory: ${{env.GITHUB_WORKSPACE}}/build
77+
working-directory: ${{env.GITHUB_WORKSPACE}}/build/clang/Release
6578
env:
6679
CTEST_OUTPUT_ON_FAILURE: 1
6780
run: ctest
6881

6982
- name: Create Release Archive
7083
run: |
71-
7z a -mx9 -r ${{ matrix.zipfile }} .\build\bin\*
84+
7z a -mx9 -r ${{ env.zipfile }} .\build\clang\Release\bin\*
7285
7386
- name: Create Installer
74-
working-directory: ${{env.GITHUB_WORKSPACE}}/build
87+
working-directory: ${{env.GITHUB_WORKSPACE}}/build/clang/Release
7588
run: cpack
7689

7790
- name: Upload Artifact
7891
uses: actions/upload-artifact@v4
7992
with:
80-
name: ${{ matrix.zipfile }}
81-
path: ${{ matrix.zipfile }}
93+
name: ${{ env.zipfile }}
94+
path: ${{ env.zipfile }}
8295

8396
- name: Create Release
8497
uses: softprops/action-gh-release@v2
8598
if: startsWith(github.ref, 'refs/tags/')
8699
with:
87100
prerelease: true
88101
files: |
89-
${{ matrix.zipfile }}
90-
build/PotatoAlert-*.msi
102+
${{ env.zipfile }}
103+
build/clang/Release/PotatoAlert-*.msi
91104
92105
build-linux:
93106
name: Build Linux Qt6
94-
strategy:
95-
matrix:
96-
include:
97-
- gcc-version: 14
107+
env:
108+
gcc-version: 14
98109

99110
runs-on: ubuntu-24.04
100111

101112
steps:
102113
- name: Checkout
103114
uses: actions/checkout@v4
104115

116+
- name: Setup Conan
117+
run: |
118+
pip install conan
119+
conan profile detect
120+
105121
- name: Setup Ninja
106122
run: sudo apt install -y ninja-build
107123

108-
- name: Ninja Version
109-
run: ninja --version
110-
111124
- name: Install Dependencies
112125
run: >
113126
sudo apt install -y
@@ -143,30 +156,45 @@ jobs:
143156
version: 6.7.2
144157
cache: true
145158

159+
- name: Conan Version
160+
run: conan --version
161+
146162
- name: CMake Version
147163
run: cmake --version
148164

149165
- name: GCC Version
150-
run: g++-${{ matrix.gcc-version }} --version
166+
run: g++-${{ env.gcc-version }} --version
167+
168+
- name: Ninja Version
169+
run: ninja --version
170+
171+
- name: Cache Conan Dependencies
172+
uses: actions/cache@v4
173+
with:
174+
path: ~/.conan2
175+
key: hashFiles('**/conanfile.py')
176+
177+
- name: Run Conan
178+
run: conan build . --build=missing --profile:all=./.github/conan/profiles/linux-gcc
151179

152180
- name: Run CMake
153181
env:
154-
CC: gcc-${{ matrix.gcc-version }}
155-
CXX: g++-${{ matrix.gcc-version }}
156-
run: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DPA_SUBMIT_URL=${{ secrets.PA_SUBMIT_URL }} -DPA_LOOKUP_URL=${{ secrets.PA_LOOKUP_URL }}
182+
CC: gcc-${{ env.gcc-version }}
183+
CXX: g++-${{ env.gcc-version }}
184+
run: cmake -S . -DPA_SUBMIT_URL=${{ secrets.PA_SUBMIT_URL }} -DPA_LOOKUP_URL=${{ secrets.PA_LOOKUP_URL }} --preset conan-gcc-release
157185

158186
- name: Run Build
159-
run: cmake --build build --config Release --target PotatoAlert CoreTest GameFileUnpackTest GameTest ReplayTest
187+
run: cmake --build build --preset conan-gcc-release --target PotatoAlert CoreTest GameFileUnpackTest GameTest ReplayTest
160188

161189
- name: Run CTest
162-
working-directory: build
190+
working-directory: build/gcc/Release
163191
env:
164192
CTEST_OUTPUT_ON_FAILURE: 1
165193
run: ctest
166194

167195
- name: Create Release Archive
168196
run: |
169-
7z a -mx9 -r PotatoAlert_linux.zip ./build/bin/*
197+
7z a -mx9 -r PotatoAlert_linux.zip ./build/gcc/Release/bin/*
170198
171199
- name: Upload Artifact
172200
uses: actions/upload-artifact@v4

Client/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@ if (NOT Qt6_FOUND)
5353
find_package(Qt5 COMPONENTS Core Network Widgets REQUIRED)
5454
endif()
5555

56+
find_package(ctre REQUIRED)
57+
find_package(fmt REQUIRED)
58+
find_package(tinyxml2 REQUIRED)
59+
5660
set_target_properties(Client PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED true)
57-
target_link_libraries(Client PRIVATE ctre tinyxml2 Win32)
61+
target_link_libraries(Client PRIVATE ctre::ctre tinyxml2::tinyxml2 Win32)
5862
target_link_libraries(Client PUBLIC Core GameFileUnpack ReplayParser fmt::fmt Qt::Core Qt::Network Qt::Widgets)
5963
target_include_directories(Client PUBLIC ${PROJECT_SOURCE_DIR}/Resources include)
6064
include(CompilerFlags)

Client/include/Client/AppDirectories.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct AppDirectories
5252
const bool exists = std::filesystem::exists(dir, ec);
5353
if (ec)
5454
{
55-
fmt::println(stderr, STR("Failed to check if app dir '{}' exists, reason: '{}'"), dir, ec);
55+
fmt::println(stderr, "Failed to check if app dir '{}' exists, reason: '{}'", dir, ec);
5656
Core::ExitCurrentProcessWithError((uint32_t)ec.value());
5757
}
5858

@@ -61,7 +61,7 @@ struct AppDirectories
6161
std::filesystem::create_directories(dir, ec);
6262
if (ec)
6363
{
64-
fmt::println(stderr, STR("Failed to create app dir '{}', reason: '{}'"), dir, ec);
64+
fmt::println(stderr, "Failed to create app dir '{}', reason: '{}'", dir, ec);
6565
Core::ExitCurrentProcessWithError((uint32_t)ec.value());
6666
}
6767
}

Client/src/Game.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "Core/Version.hpp"
1515
#include "Core/Xml.hpp"
1616

17-
#include <ctre/ctre.hpp>
17+
#include <ctre.hpp>
1818

1919
#include <filesystem>
2020
#include <ranges>

Core/CMakeLists.txt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,20 @@ if (NOT Qt6_FOUND)
7373
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
7474
endif()
7575

76+
find_package(ctre REQUIRED)
77+
find_package(date REQUIRED)
78+
find_package(fmt REQUIRED)
79+
find_package(OpenSSL REQUIRED)
80+
find_package(RapidJSON REQUIRED)
81+
find_package(spdlog REQUIRED)
82+
find_package(SQLite3 REQUIRED)
83+
find_package(tinyxml2 REQUIRED)
84+
find_package(zip REQUIRED)
85+
find_package(ZLIB REQUIRED)
86+
7687
set_target_properties(Core PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED true)
77-
target_link_libraries(Core PRIVATE ctre date::date sqlite3 OpenSSL zip ZLIB::ZLIB)
78-
target_link_libraries(Core PUBLIC Qt::Core Qt::Widgets RapidJson fmt::fmt spdlog tinyxml2)
88+
target_link_libraries(Core PRIVATE ctre::ctre date::date SQLite::SQLite3 openssl::openssl zip::zip ZLIB::ZLIB)
89+
target_link_libraries(Core PUBLIC Qt::Core Qt::Widgets rapidjson fmt::fmt spdlog::spdlog_header_only tinyxml2::tinyxml2)
7990
target_include_directories(Core PUBLIC include)
8091
include(CompilerFlags)
8192
SetCompilerFlags(Core)

Core/include/Core/String.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct fmt::formatter<StringWrap, wchar_t>
8181
return ctx.begin();
8282
}
8383

84-
auto format(const StringWrap& val, buffer_context<wchar_t>& ctx) const -> buffer_context<wchar_t>::iterator
84+
auto format(const StringWrap& val, buffered_context<wchar_t>& ctx) const -> buffered_context<wchar_t>::iterator
8585
{
8686
if (const PotatoAlert::Core::Result<size_t> length = PotatoAlert::Core::Utf8ToWide(val.Str))
8787
{

Core/src/Version.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "Core/String.hpp"
55
#include "Core/Version.hpp"
66

7-
#include <ctre/ctre.hpp>
7+
#include <ctre.hpp>
88

99
#include <string>
1010

Core/src/Zip.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "Core/Zip.hpp"
77

88
PA_SUPPRESS_WARN_BEGIN
9-
#include <zip.h>
9+
#include <zip/zip.h>
1010
PA_SUPPRESS_WARN_END
1111

1212
#include <cstdint>
@@ -138,5 +138,5 @@ uint64_t Zip::SizeEntry() const
138138

139139
int Zip::EntryCount() const
140140
{
141-
return zip_total_entries(UnwrapHandle<zip_t*>(m_handle));
141+
return zip_entries_total(UnwrapHandle<zip_t*>(m_handle));
142142
}

ReplayParser/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ target_sources(
2222
)
2323
set_target_properties(ReplayParser PROPERTIES CXX_STANDARD 23 CXX_STANDARD_REQUIRED true)
2424
target_include_directories(ReplayParser PUBLIC include)
25-
target_link_libraries(ReplayParser PUBLIC tinyxml2 Core ReplayAnalyzer)
25+
find_package(tinyxml2 REQUIRED)
26+
target_link_libraries(ReplayParser PUBLIC tinyxml2::tinyxml2 Core ReplayAnalyzer)
2627
include(CompilerFlags)
2728
SetCompilerFlags(ReplayParser)
2829

Test/CoreTest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_executable(CoreTest CoreTest.cpp)
2+
find_package(Catch2 REQUIRED)
23
target_link_libraries(CoreTest PRIVATE Core Catch2::Catch2WithMain)
34
set_target_properties(CoreTest
45
PROPERTIES

Test/GameFileUnpackTest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_executable(GameFileUnpackTest GameFileUnpackTest.cpp)
2+
find_package(Catch2 REQUIRED)
23
target_link_libraries(GameFileUnpackTest PRIVATE Core Catch2::Catch2WithMain GameFileUnpack)
34
set_target_properties(GameFileUnpackTest
45
PROPERTIES

Test/GameTest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_executable(GameTest GameTest.cpp)
2+
find_package(Catch2 REQUIRED)
23
target_link_libraries(GameTest PRIVATE Client Core Catch2::Catch2WithMain)
34
set_target_properties(GameTest
45
PROPERTIES

Test/PythonTest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_executable(PythonTest PythonTest.cpp)
2+
find_package(Catch2 REQUIRED)
23
target_link_libraries(PythonTest PRIVATE Core Catch2::Catch2WithMain)
34
set_target_properties(PythonTest
45
PROPERTIES

Test/ReplayTest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
add_executable(ReplayTest ReplayTest.cpp)
2+
find_package(Catch2 REQUIRED)
23
target_link_libraries(ReplayTest PRIVATE Core Catch2::Catch2WithMain ReplayParser)
34
set_target_properties(ReplayTest
45
PROPERTIES

0 commit comments

Comments
 (0)