Skip to content

Commit 651e00a

Browse files
authored
Update for 1.40.4 (#3)
1 parent 5b9f83a commit 651e00a

17 files changed

+237
-234
lines changed

.github/actions/canary-ndk/action.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/build-ndk.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- 'master'
8+
- 'dev'
89
paths-ignore:
910
- '**.yml'
1011
- '!.github/workflows/build-ndk.yml'
@@ -38,14 +39,9 @@ jobs:
3839

3940
- uses: seanmiddleditch/gha-setup-ninja@v3
4041

41-
# Use canary NDK to avoid lesser known compile bugs
42-
- name: Setup canary NDK
43-
id: setup-ndk
44-
uses: ./.github/actions/canary-ndk
45-
4642
- name: Create ndkpath.txt
4743
run: |
48-
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
44+
echo $ANDROID_NDK_HOME > ${GITHUB_WORKSPACE}/ndkpath.txt
4945
cat ${GITHUB_WORKSPACE}/ndkpath.txt
5046
5147
# get version from pushed tag
@@ -79,21 +75,21 @@ jobs:
7975
echo "NAME=${files[0]}" >> $GITHUB_OUTPUT
8076
8177
- name: Upload non-debug artifact
82-
uses: actions/upload-artifact@v2
78+
uses: actions/upload-artifact@v4
8379
with:
8480
name: ${{ steps.libname.outputs.NAME }}
8581
path: ./build/${{ steps.libname.outputs.NAME }}
8682
if-no-files-found: error
8783

8884
- name: Upload debug artifact
89-
uses: actions/upload-artifact@v2
85+
uses: actions/upload-artifact@v4
9086
with:
9187
name: debug_${{ steps.libname.outputs.NAME }}
9288
path: ./build/debug/${{ steps.libname.outputs.NAME }}
9389
if-no-files-found: error
9490

9591
- name: Upload qmod artifact
96-
uses: actions/upload-artifact@v2
92+
uses: actions/upload-artifact@v4
9793
with:
9894
name: ${{env.qmodName}}.qmod
9995
path: ./${{ env.qmodName }}.qmod

.github/workflows/publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,9 @@ jobs:
2222

2323
- uses: seanmiddleditch/gha-setup-ninja@v3
2424

25-
# Use canary NDK to avoid lesser known compile bugs
26-
- name: Setup canary NDK
27-
id: setup-ndk
28-
uses: ./.github/actions/canary-ndk
29-
3025
- name: Create ndkpath.txt
3126
run: |
32-
echo ${{ steps.setup-ndk.outputs.ndk-path }} > ${GITHUB_WORKSPACE}/ndkpath.txt
27+
echo $ANDROID_NDK_HOME > ${GITHUB_WORKSPACE}/ndkpath.txt
3328
cat ${GITHUB_WORKSPACE}/ndkpath.txt
3429
3530
# get version from pushed tag

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.vs/
2+
.cache/
23

34
# Prerequisites
45
*.d

CMakeLists.txt

Lines changed: 72 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
# include some defines automatically made by qpm
22
include(qpm_defines.cmake)
3-
include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake)
43

5-
add_definitions(-DPAPER_DISABLE_SOURCE_LOC)
6-
add_definitions(-DCP_SDK_BMBF)
4+
cmake_minimum_required(VERSION 3.22)
5+
project(${COMPILE_ID})
76

8-
# override mod id
9-
set(MOD_ID "QBeatSaberPlus-NoteTweaker")
7+
# c++ standard
8+
set(CMAKE_CXX_STANDARD 20)
9+
set(CMAKE_CXX_STANDARD_REQUIRED 20)
1010

1111
# Enable link time optimization
1212
# In my experience, this can be highly unstable but it nets a huge size optimization and likely performance
1313
# However, the instability was seen using Android.mk/ndk-build builds. With Ninja + CMake, this problem seems to have been solved.
1414
# As always, test thoroughly
1515
# - Fern
1616
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
17-
18-
cmake_minimum_required(VERSION 3.21)
19-
project(${COMPILE_ID})
20-
2117
# export compile commands for significantly better intellisense
2218
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2319

24-
# c++ standard
25-
set(CMAKE_CXX_STANDARD 20)
26-
set(CMAKE_CXX_STANDARD_REQUIRED 20)
27-
2820
# define that stores the actual source directory
2921
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
3022
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
3123
set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shared)
3224

25+
# stop symbol leaking
26+
#add_link_options(-Wl,--exclude-libs,ALL)
3327
# compile options used
34-
add_compile_options(-frtti -fexceptions)
35-
add_compile_options(-O3)
28+
add_compile_options(-frtti -fPIE -fPIC -fexceptions -fdeclspec -fvisibility=hidden -Wno-extra-qualification -O3)
3629

3730
# get git info
3831
execute_process(COMMAND git config user.name OUTPUT_VARIABLE GIT_USER)
@@ -50,102 +43,105 @@ message(STATUS "GIT_BRANCH: ${GIT_BRANCH}")
5043
message(STATUS "GIT_COMMIT: 0x${GIT_COMMIT}")
5144
message(STATUS "GIT_MODIFIED: ${GIT_MODIFIED}")
5245

53-
# set git defines
54-
add_compile_definitions(GIT_USER=\"${GIT_USER}\")
55-
add_compile_definitions(GIT_BRANCH=\"${GIT_BRANCH}\")
56-
add_compile_definitions(GIT_COMMIT=0x${GIT_COMMIT})
57-
add_compile_definitions(GIT_MODIFIED=${GIT_MODIFIED})
46+
47+
# Check for file presence and read current contents
48+
set(GIT_INFO_H_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include/git_info.h")
49+
if(EXISTS "${GIT_INFO_H_PATH}")
50+
file(READ "${GIT_INFO_H_PATH}" GIT_INFO_H_CURRENT)
51+
else()
52+
set(GIT_INFO_H_CURRENT "")
53+
endif()
54+
55+
# Define new git info content
56+
set(GIT_INFO_H "#pragma once
57+
#define GIT_USER \"${GIT_USER}\"
58+
#define GIT_BRANCH \"${GIT_BRANCH}\"
59+
#define GIT_COMMIT 0x${GIT_COMMIT}
60+
#define GIT_MODIFIED ${GIT_MODIFIED}
61+
")
62+
63+
# Write git info to file if the contents have changed
64+
if(NOT "${GIT_INFO_H}" STREQUAL "${GIT_INFO_H_CURRENT}")
65+
file(WRITE "${GIT_INFO_H_PATH}" "${GIT_INFO_H}")
66+
endif()
67+
5868

5969
# compile definitions used
6070
add_compile_definitions(VERSION=\"${MOD_VERSION}\")
6171
add_compile_definitions(MOD_ID=\"${MOD_ID}\")
72+
add_compile_definitions(UNITY_2021)
73+
add_compile_definitions(CORDL_RUNTIME_FIELD_NULL_CHECKS)
74+
add_compile_definitions(__USE_LARGEFILE64)
75+
76+
# compile options used
77+
add_compile_definitions(CP_SDK_BMBF)
78+
79+
string(LENGTH "${CMAKE_CURRENT_LIST_DIR}/" FOLDER_LENGTH)
80+
add_compile_definitions("PAPER_ROOT_FOLDER_LENGTH=${FOLDER_LENGTH}")
6281

6382
# recursively get all src files
64-
RECURSE_FILES(h_file_lista ${INCLUDE_DIR}/*.hpp)
65-
RECURSE_FILES(h_file_listb ${SHARED_DIR}/*.hpp)
66-
RECURSE_FILES(hpp_file_lista ${INCLUDE_DIR}/*.hpp)
67-
RECURSE_FILES(hpp_file_listb ${SHARED_DIR}/*.hpp)
68-
RECURSE_FILES(cpp_file_list ${SOURCE_DIR}/*.cpp)
69-
RECURSE_FILES(c_file_list ${SOURCE_DIR}/*.c)
83+
recurse_files(cpp_file_list ${SOURCE_DIR}/*.cpp)
84+
recurse_files(c_file_list ${SOURCE_DIR}/*.c)
85+
86+
recurse_files(inline_hook_c ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.c)
87+
recurse_files(inline_hook_cpp ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.cpp)
7088

7189
# add all src files to compile
7290
add_library(
73-
${COMPILE_ID}
74-
SHARED
75-
${h_file_lista}
76-
${h_file_listb}
77-
${hpp_file_lista}
78-
${hpp_file_listb}
79-
${cpp_file_list}
80-
${c_file_list}
91+
${COMPILE_ID} SHARED ${cpp_file_list} ${c_file_list} ${inline_hook_c} ${inline_hook_cpp}
8192
)
8293

83-
# Add any assets
84-
#add_assets(assets_${COMPILE_ID} STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp)
85-
86-
# get the vcpkg dir from env variables
87-
if(EXISTS $ENV{VCPKG_ROOT})
88-
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
89-
else()
90-
MESSAGE(ERROR "Please define the environment variable VCPKG_ROOT with the root to your vcpkg install!")
91-
endif()
92-
93-
target_include_directories(${COMPILE_ID} PRIVATE .)
94-
9594
# add src dir as include dir
9695
target_include_directories(${COMPILE_ID} PRIVATE ${SOURCE_DIR})
9796
# add include dir as include dir
9897
target_include_directories(${COMPILE_ID} PRIVATE ${INCLUDE_DIR})
9998
# add shared dir as include dir
10099
target_include_directories(${COMPILE_ID} PUBLIC ${SHARED_DIR})
101-
# codegen includes
102-
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGEN_ID}/include)
103100
# chatplex-sdk-bs includes
104101
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/chatplex-sdk-bs/shared)
105102

106-
target_link_libraries(${COMPILE_ID} PRIVATE -llog)
107-
#target_link_libraries(${COMPILE_ID} PRIVATE assets_${COMPILE_ID})
103+
target_link_libraries(${COMPILE_ID} PRIVATE -llog -lz)
108104

109105
# add extern stuff like libs and other includes
110106
include(extern.cmake)
111107

112108
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
113-
COMMAND ${CMAKE_STRIP} -d --strip-all
114-
"lib${COMPILE_ID}.so" -o "stripped_lib${COMPILE_ID}.so"
115-
COMMENT "Strip debug symbols done on final binary.")
109+
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all
110+
"lib${COMPILE_ID}.so" -o "stripped_lib${COMPILE_ID}.so"
111+
COMMENT "Strip debug symbols done on final binary.")
116112

117113
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
118114
COMMAND ${CMAKE_COMMAND} -E make_directory debug
119115
COMMENT "Make directory for debug symbols"
120116
)
121117

122118
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
123-
COMMAND ${CMAKE_COMMAND} -E rename lib${COMPILE_ID}.so debug/lib${COMPILE_ID}.so
124-
COMMENT "Rename the lib to debug_ since it has debug symbols"
125-
)
119+
COMMAND ${CMAKE_COMMAND} -E rename lib${COMPILE_ID}.so debug/lib${COMPILE_ID}.so
120+
COMMENT "Rename the lib to debug_ since it has debug symbols"
121+
)
126122

127-
# strip debug symbols from the .so and all dependencies
128123
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
129-
COMMAND ${CMAKE_COMMAND} -E rename stripped_lib${COMPILE_ID}.so lib${COMPILE_ID}.so
130-
COMMENT "Rename the stripped lib to regular"
131-
)
132-
foreach(so_file ${so_list})
133-
cmake_path(GET so_file FILENAME file)
124+
COMMAND ${CMAKE_COMMAND} -E rename stripped_lib${COMPILE_ID}.so lib${COMPILE_ID}.so
125+
COMMENT "Rename the stripped lib to regular"
126+
)
134127

135-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
136-
COMMAND ${CMAKE_COMMAND} -E copy ${so_file} debug/${file}
137-
COMMENT "Copy so files for ndk stack"
138-
)
128+
foreach(so_file ${so_list})
129+
cmake_path(GET so_file FILENAME file)
130+
131+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
132+
COMMAND ${CMAKE_COMMAND} -E copy ${so_file} debug/${file}
133+
COMMENT "Copy so files for ndk stack"
134+
)
139135

140-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
141-
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all ${so_file} -o ${file}
142-
COMMENT "Strip debug symbols from the dependencies")
143-
endforeach()
136+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
137+
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all ${so_file} -o ${file}
138+
COMMENT "Strip debug symbols from the dependencies")
139+
endforeach()
144140

145-
foreach(a_file ${a_list})
146-
cmake_path(GET a_file FILENAME file)
141+
foreach(a_file ${a_list})
142+
cmake_path(GET a_file FILENAME file)
147143

148-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
149-
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
150-
COMMENT "Copy a files for ndk stack")
151-
endforeach()
144+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
145+
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
146+
COMMENT "Copy a files for ndk stack")
147+
endforeach()

include/git_info.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#pragma once
2+
#define GIT_USER "HardCPP"
3+
#define GIT_BRANCH "dev"
4+
#define GIT_COMMIT 0x136cce8
5+
#define GIT_MODIFIED 1

mod.json

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
{
2+
"$schema": "https://raw.githubusercontent.com/Lauriethefish/QuestPatcher.QMod/refs/heads/main/QuestPatcher.QMod/Resources/qmod.schema.json",
23
"_QPVersion": "0.1.1",
34
"name": "QBeatSaberPlus-NoteTweaker",
45
"id": "qbeatsaberplus-notetweaker",
56
"modloader": "Scotland2",
67
"author": "HardCPP",
7-
"version": "6.3.2",
8+
"version": "6.4.0",
89
"packageId": "com.beatgames.beatsaber",
9-
"packageVersion": "1.37.0_9064817954",
10+
"packageVersion": "1.40.4_5283",
1011
"description": "Feel good!",
1112
"coverImage": "cover.png",
1213
"dependencies": [
1314
{
14-
"version": "^0.17.8",
15+
"version": "^6.4.1",
16+
"id": "beatsaber-hook",
17+
"downloadIfMissing": "https://github.com/QuestPackageManager/beatsaber-hook/releases/download/v6.4.1/beatsaber-hook.qmod"
18+
},
19+
{
20+
"version": "^0.18.2",
1521
"id": "custom-types",
16-
"downloadIfMissing": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.17.10/CustomTypes.qmod"
22+
"downloadIfMissing": "https://github.com/QuestPackageManager/Il2CppQuestTypePatching/releases/download/v0.18.2/CustomTypes.qmod"
1723
},
1824
{
19-
"version": "^3.6.3",
20-
"id": "paper",
21-
"downloadIfMissing": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.4/paperlog.qmod"
25+
"version": "^4.6.1",
26+
"id": "paper2_scotland2",
27+
"downloadIfMissing": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.3/paper2_scotland2.qmod"
2228
},
2329
{
24-
"version": "^6.3.2",
30+
"version": "^6.4.0",
2531
"id": "chatplex-sdk-bs",
26-
"downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.2/ChatPlexSDK-BS.qmod"
32+
"downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.4.0/ChatPlexSDK-BS.qmod"
2733
}
2834
],
29-
"modFiles": [],
30-
"lateModFiles": [
35+
"modFiles": [
3136
"libqbeatsaberplus-notetweaker.so"
3237
],
33-
"libraryFiles": [
34-
"libbeatsaber-hook_5_1_9.so"
35-
],
38+
"lateModFiles": [],
39+
"libraryFiles": [],
3640
"fileCopies": [],
3741
"copyExtensions": []
3842
}

0 commit comments

Comments
 (0)