Skip to content

Commit 9492ea9

Browse files
authored
Merge pull request #16 from AmeliaCute/master
Update origin/dev
2 parents 04dcf2e + 1410b63 commit 9492ea9

Some content is hidden

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

66 files changed

+2295
-28726
lines changed

.github/workflows/cd.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "Build and deploy project"
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
env:
8+
BUILD_TYPE: Release
9+
10+
jobs:
11+
build:
12+
runs-on: windows-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Pull submodule
17+
run: git submodule update --init
18+
19+
- name: Configure CMake
20+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
21+
22+
- name: Build project
23+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
24+
25+
- name: Upload Artifacts
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: fli-modloader
29+
path: |
30+
./build/Release/ModLoader.dll
31+
./build/DllProxy/Release/version.dll
32+
release:
33+
needs: build
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Set up date-based tag
37+
run: |
38+
DATE_TAG="v$(date +'%Y%m%d.%H%M')"
39+
echo "TAG_NAME=$DATE_TAG" >> $GITHUB_ENV
40+
echo "{tag}=$DATE_TAG"
41+
- name: Download Artifacts
42+
uses: actions/download-artifact@v4
43+
- name: Create GitHub Release
44+
id: create_release
45+
uses: softprops/action-gh-release@v2
46+
with:
47+
tag_name: ${{ env.TAG_NAME }}
48+
body: "Automated release of ${{ github.ref_name }}."
49+
generate_release_notes: true
50+
token: ${{ secrets.RELEASE_CD_TOKEN }}
51+
52+
- name: Upload ModLoader.dll
53+
uses: actions/upload-release-asset@v1
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.RELEASE_CD_TOKEN }}
56+
with:
57+
upload_url: ${{ steps.create_release.outputs.upload_url }}
58+
asset_path: "./fli-modloader/Release/ModLoader.dll"
59+
asset_name: ModLoader.dll
60+
asset_content_type: application/octet-stream
61+
62+
- name: Upload version.dll
63+
uses: actions/upload-release-asset@v1
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.RELEASE_CD_TOKEN }}
66+
with:
67+
upload_url: ${{ steps.create_release.outputs.upload_url }}
68+
asset_path: "./fli-modloader/DllProxy/Release/version.dll"
69+
asset_name: version.dll
70+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
lib
2-
FantasyL.b1c5f0c2
3-
.vs
4-
.vscode
5-
.intellij
6-
x64
7-
*/.github
8-
build
9-
out
1+
*
2+
!include/
3+
!include/**/*
4+
!src/
5+
!src/**/*
6+
#!CMakeLists.txt
7+
!README.md
8+
!.github/
9+
!.github/**/*
10+
!version_proxy.def

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "include"]
2+
path = include
3+
url = https://github.com/ReDevCafe/FantasyLifeI-ModLoader-Headers.git

CMakeLists.txt

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
11
CMAKE_MINIMUM_REQUIRED(VERSION 3.6)
22
PROJECT(FantasyLifeI-ModLoader LANGUAGES CXX C)
33

4-
add_library(${PROJECT_NAME} SHARED src/dllmain.cpp)
4+
set(VERSION 1.00)
5+
option(MLDEBUG "Enable ModLoader debug code" ON)
6+
7+
add_subdirectory(DllProxy)
8+
add_library(${PROJECT_NAME} SHARED src/ModLoader.cpp)
59

610
set_target_properties(${PROJECT_NAME} PROPERTIES
711
OUTPUT_NAME "ModLoader"
8-
CXX_STANDARD 17
12+
CXX_STANDARD 20
913
CXX_STANDARD_REQUIRED YES
1014
)
1115

16+
target_compile_definitions(${PROJECT_NAME} PRIVATE MLCOMPILED)
17+
target_compile_definitions(${PROJECT_NAME} PRIVATE MLVERSION=\"${VERSION}\")
18+
19+
if(MLDEBUG)
20+
target_compile_definitions(${PROJECT_NAME} PRIVATE MLDEBUG)
21+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
22+
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
23+
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
24+
25+
if(MSVC)
26+
target_compile_options(FantasyLifeI-ModLoader PRIVATE /wd4369 /wd4309)
27+
endif()
28+
endif()
29+
1230
target_include_directories(${PROJECT_NAME} PUBLIC
1331
${CMAKE_CURRENT_SOURCE_DIR}/include
14-
${CMAKE_CURRENT_SOURCE_DIR}/MinHook/include
15-
)
16-
17-
target_precompile_headers(${PROJECT_NAME}
18-
PUBLIC
19-
include/pch.h
2032
)
2133
2234
target_link_libraries(${PROJECT_NAME} PUBLIC
@@ -25,9 +37,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC
2537
)
2638
2739
file(GLOB_RECURSE PROJECT_SOURCE "src/*.cpp")
28-
file(GLOB_RECURSE MINHOOK_SOURCE "MinHook/src/*.c")
2940
3041
target_sources(${PROJECT_NAME} PUBLIC
3142
${PROJECT_SOURCE}
32-
${MINHOOK_SOURCE}
33-
)
43+
)

DllProxy/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.6)
2+
PROJECT(DllProxy LANGUAGES CXX C)
3+
4+
add_library(${PROJECT_NAME} SHARED src/dllmain.cpp)
5+
6+
set_target_properties(${PROJECT_NAME} PROPERTIES
7+
OUTPUT_NAME "version"
8+
CXX_STANDARD 17
9+
CXX_STANDARD_REQUIRED YES
10+
)
11+
12+
target_include_directories(${PROJECT_NAME} PUBLIC
13+
${CMAKE_CURRENT_SOURCE_DIR}/include
14+
)
15+
16+
if(MSVC)
17+
target_compile_options(${PROJECT_NAME} PRIVATE /MT /EHsc /DWIN32_LEAN_AND_MEAN)
18+
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/version_proxy.def")
19+
endif()
20+
21+
target_link_libraries(${PROJECT_NAME} PUBLIC
22+
user32
23+
kernel32
24+
)
25+
26+
file(GLOB_RECURSE PROJECT_SOURCE "src/*.cpp")
27+
28+
target_sources(${PROJECT_NAME} PUBLIC
29+
${PROJECT_SOURCE}
30+
)

0 commit comments

Comments
 (0)