Skip to content

Commit da8bd07

Browse files
committed
Fix compile issues
change: switch to my mingw repo for plugin-sdk Diable warning for invalid offsetof in build config Update plugin-sdk reference to use mingw repository fixup fix: resolve issues with new psdk commits fixup fixup fix2 Update build script to use Clang 20 instead of 23 Upgrade Clang to version 23 in build workflow Updated Clang version from 20 to 23 and modified installation steps accordingly. Remove C++ flags from xmake configuration Removed unnecessary C++ flags from build configuration.
1 parent f40a95d commit da8bd07

6 files changed

Lines changed: 137 additions & 129 deletions

File tree

.github/workflows/build.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Based on CanerKaraca23 build script
1+
# Based on CanerKaraca20 build script
22
name: Build ModelExtras
33

44
on:
@@ -25,12 +25,24 @@ jobs:
2525
- name: Install dependencies
2626
run: |
2727
sudo apt-get update
28-
sudo apt-get install -y clang-19 g++-mingw-w64-i686
28+
sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686
29+
30+
# Download LLVM installer script
31+
wget https://apt.llvm.org/llvm.sh
32+
chmod +x llvm.sh
33+
34+
# Install Clang 23
35+
sudo ./llvm.sh 23
36+
37+
- name: Verify Clang
38+
run: |
39+
clang --version
40+
clang++ --version
2941
3042
- name: Get latest plugin-sdk commit
3143
id: plugin-sdk-ref
3244
run: |
33-
echo "sha=$(git ls-remote https://github.com/DK22Pac/plugin-sdk.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
45+
echo "sha=$(git ls-remote https://github.com/user-grinch/plugin-sdk-mingw.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
3446
3547
- name: Restore plugin-sdk cache
3648
id: plugin-sdk-cache
@@ -42,26 +54,22 @@ jobs:
4254
- name: Build plugin-sdk
4355
if: steps.plugin-sdk-cache.outputs.cache-hit != 'true'
4456
run: |
45-
# Clone repo and check out the exact commit used in the cache key
46-
git clone https://github.com/DK22Pac/plugin-sdk.git plugin-sdk
57+
git clone https://github.com/user-grinch/plugin-sdk-mingw.git plugin-sdk
4758
cd plugin-sdk
4859
git checkout "${{ steps.plugin-sdk-ref.outputs.sha }}"
4960
mkdir -p output/lib
50-
# Prepare object directories
5161
for dir in shared plugin_sa safetyhook; do
5262
find "$dir" -type d -exec mkdir -p "obj/{}" \;
5363
done
5464
55-
# Common flags
5665
FLAGS="-I. -Ishared -Ishared/game -Iplugin_sa -Iplugin_sa/game_sa -Iplugin_sa/game_sa/rw -Isafetyhook -DGTASA -DPLUGIN_SGV_10US -DRW"
57-
CLANG_FLAGS="--target=i686-w64-mingw32 -fpermissive -fcommon -fms-extensions -Wno-microsoft-include -O2 -D__cpp_concepts=202002L"
66+
CLANG_FLAGS="--target=i686-w64-mingw32 -fpermissive -fcommon -fms-extensions -Wno-microsoft-include -Wno-invalid-offsetof -Wno-builtin-macro-redefined -O2 -D__cpp_concepts=202202L"
5867
59-
# Parallel build
6068
find shared plugin_sa safetyhook -name '*.cpp' -print0 | \
61-
xargs -0 -P$(nproc) -I{} clang++-19 $CLANG_FLAGS -std=c++2b $FLAGS -c {} -o obj/{}.o
69+
xargs -0 -P$(nproc) -I{} clang++-23 $CLANG_FLAGS -std=c++2b $FLAGS -c {} -o obj/{}.o
6270
6371
find safetyhook -name '*.c' -print0 | \
64-
xargs -0 -P$(nproc) -I{} clang-19 $CLANG_FLAGS $FLAGS -c {} -o obj/{}.o
72+
xargs -0 -P$(nproc) -I{} clang-23 $CLANG_FLAGS $FLAGS -c {} -o obj/{}.o
6573
6674
find obj -name '*.o' | xargs i686-w64-mingw32-ar rcs output/lib/libplugin.a
6775
@@ -75,9 +83,8 @@ jobs:
7583
run: |
7684
xmake f -m release \
7785
--mingw=/usr \
78-
--cc=clang-19 \
79-
--cxx=clang++-19 \
80-
--cxflags="-D__cpp_concepts=202002L" \
86+
--cc=clang-23 \
87+
--cxx=clang++-23 \
8188
-c -y
8289
xmake -j$(nproc)
8390

0 commit comments

Comments
 (0)