-
Notifications
You must be signed in to change notification settings - Fork 144
fix: compile issues under linux (gcc-clang) #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
user-grinch
wants to merge
5
commits into
DK22Pac:master
Choose a base branch
from
user-grinch:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
24ae25e
fix: compile issues under linux (gcc-clang)
user-grinch 8d18b43
fix: preverse alphabetical ordering for includes
user-grinch 4dea31f
add sa clang workflow
user-grinch 117fbe3
fix: workflow build issues
user-grinch 12e4a72
fix: msvc sa workflow issue
user-grinch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| name: Plugin GTA SA (Clang) | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| push: | ||
| paths: | ||
| - "!**.dll" | ||
| - "!**.md" | ||
| - "!**.txt" | ||
| - "tools/premake/**" | ||
| - "hooking/**" | ||
| - "injector/**" | ||
| - "modutils/**" | ||
| - "safetyhook/**" | ||
| - "shared/**" | ||
| - "plugin_sa/**" | ||
|
|
||
| pull_request: | ||
| paths: | ||
| - "!**.dll" | ||
| - "!**.md" | ||
| - "!**.txt" | ||
| - "tools/premake/**" | ||
| - "hooking/**" | ||
| - "injector/**" | ||
| - "modutils/**" | ||
| - "safetyhook/**" | ||
| - "shared/**" | ||
| - "plugin_sa/**" | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: "recursive" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y wget gnupg software-properties-common lsb-release g++-mingw-w64-i686 | ||
| # Download LLVM installer script | ||
| wget https://apt.llvm.org/llvm.sh | ||
| chmod +x llvm.sh | ||
| # Install Clang 23 | ||
| sudo ./llvm.sh 23 | ||
| - name: Verify Clang | ||
| run: | | ||
| clang-23 --version | ||
| clang++-23 --version | ||
| - name: Build SDK | ||
| run: | | ||
| echo "::group::Setup directories" | ||
| mkdir -p output/lib | ||
| for dir in shared plugin_sa safetyhook; do | ||
| find "$dir" -type d -exec mkdir -p "obj/{}" \; | ||
| done | ||
| echo "::groupEnd::" | ||
| FLAGS="-I. -Ishared -Ishared/game -Iplugin_sa -Iplugin_sa/game_sa -Iplugin_sa/game_sa/rw -Isafetyhook -DGTASA -DPLUGIN_SGV_10US -DRW" | ||
| 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" | ||
| echo "::group::Compile C++ files" | ||
| find shared plugin_sa safetyhook -name '*.cpp' -print0 | \ | ||
| xargs -0 -P$(nproc) -I{} clang++-23 $CLANG_FLAGS -std=c++2b $FLAGS -c {} -o obj/{}.o | ||
| echo "::groupEnd::" | ||
| echo "::group::Compile C files" | ||
| find safetyhook -name '*.c' -print0 | \ | ||
| xargs -0 -P$(nproc) -I{} clang-23 $CLANG_FLAGS $FLAGS -c {} -o obj/{}.o | ||
| echo "::groupEnd::" | ||
| echo "::group::Archive SDK" | ||
| find obj -name '*.o' | xargs i686-w64-mingw32-ar rcs output/lib/libplugin.a | ||
| echo "::groupEnd::" | ||
| - name: Build test plugin | ||
| run: | | ||
| echo "::group::Build test plugin" | ||
| # Setup object directories for the test plugin | ||
| find examples/Test -type d -exec mkdir -p "obj/{}" \; | ||
| mkdir -p output/examples | ||
| TEST_FLAGS="-I. -Ishared -Ishared/game -Iplugin_sa -Iplugin_sa/game_sa -Iplugin_sa/game_sa/rw -Isafetyhook -DGTASA -DPLUGIN_SGV_10US -DRW" | ||
| TEST_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" | ||
| # Compile | ||
| find examples/Test -name '*.cpp' -print0 | \ | ||
| xargs -0 -P$(nproc) -I{} clang++-23 $TEST_CLANG_FLAGS -std=c++2b $TEST_FLAGS -c {} -o obj/{}.o | ||
| # Link into ASI | ||
| clang++-23 --target=i686-w64-mingw32 -shared -o output/examples/Test.asi $(find obj/examples/Test -name '*.o') -Loutput/lib -lplugin -static-libgcc -static-libstdc++ -Wl,--enable-stdcall-fixup | ||
| echo "::groupEnd::" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,8 +7,19 @@ | |
| #pragma once | ||
|
|
||
| #include "PluginBase.h" | ||
| #include "CTaskSimple.h" | ||
| #include "CAEAudioEntity.h" | ||
| #include "CAnimBlock.h" | ||
| #include "CTaskSimple.h" | ||
| #include "CVector.h" | ||
| #include "eAnimations.h" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still not alphabetical order. |
||
|
|
||
| class CEntity; | ||
| class CAnimBlendAssociation; | ||
| class CAnimBlendHierarchy; | ||
|
|
||
| #ifndef _MSC_VER | ||
| class CVector; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary? CVector should be seen as struct everywhere now. |
||
| #endif | ||
|
|
||
| class PLUGIN_API CTaskSimpleHoldEntity : public CTaskSimple { | ||
| protected: | ||
|
|
||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was that needed?