Skip to content

Commit 150eee2

Browse files
committed
Version 6.4.0
1 parent 2885bc7 commit 150eee2

16 files changed

Lines changed: 270 additions & 241 deletions

File tree

.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: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
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(-DCP_SDK_BMBF)
4+
cmake_minimum_required(VERSION 3.22)
5+
project(${COMPILE_ID})
6+
include(${EXTERN_DIR}/includes/kaleb/shared/cmake/assets.cmake)
67

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

1012
# Enable link time optimization
1113
# In my experience, this can be highly unstable but it nets a huge size optimization and likely performance
1214
# However, the instability was seen using Android.mk/ndk-build builds. With Ninja + CMake, this problem seems to have been solved.
1315
# As always, test thoroughly
1416
# - Fern
1517
# set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
16-
17-
cmake_minimum_required(VERSION 3.21)
18-
project(${COMPILE_ID})
19-
2018
# export compile commands for significantly better intellisense
2119
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2220

23-
# c++ standard
24-
set(CMAKE_CXX_STANDARD 20)
25-
set(CMAKE_CXX_STANDARD_REQUIRED 20)
26-
2721
# define that stores the actual source directory
2822
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
2923
set(INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
3024
set(SHARED_DIR ${CMAKE_CURRENT_SOURCE_DIR}/shared)
3125

26+
# stop symbol leaking
27+
#add_link_options(-Wl,--exclude-libs,ALL)
3228
# compile options used
33-
add_compile_options(-frtti -fexceptions)
34-
add_compile_options(-O3)
29+
add_compile_options(-frtti -fPIE -fPIC -fexceptions -fdeclspec -fvisibility=hidden -Wno-extra-qualification -O3)
3530

3631
# get git info
3732
execute_process(COMMAND git config user.name OUTPUT_VARIABLE GIT_USER)
@@ -49,102 +44,107 @@ message(STATUS "GIT_BRANCH: ${GIT_BRANCH}")
4944
message(STATUS "GIT_COMMIT: 0x${GIT_COMMIT}")
5045
message(STATUS "GIT_MODIFIED: ${GIT_MODIFIED}")
5146

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

5870
# compile definitions used
5971
add_compile_definitions(VERSION=\"${MOD_VERSION}\")
6072
add_compile_definitions(MOD_ID=\"${MOD_ID}\")
73+
add_compile_definitions(UNITY_2021)
74+
add_compile_definitions(CORDL_RUNTIME_FIELD_NULL_CHECKS)
75+
add_compile_definitions(__USE_LARGEFILE64)
76+
77+
# compile options used
78+
add_compile_definitions(CP_SDK_BMBF)
79+
80+
string(LENGTH "${CMAKE_CURRENT_LIST_DIR}/" FOLDER_LENGTH)
81+
add_compile_definitions("PAPER_ROOT_FOLDER_LENGTH=${FOLDER_LENGTH}")
6182
6283
# recursively get all src files
63-
RECURSE_FILES(h_file_lista ${INCLUDE_DIR}/*.hpp)
64-
RECURSE_FILES(h_file_listb ${SHARED_DIR}/*.hpp)
65-
RECURSE_FILES(hpp_file_lista ${INCLUDE_DIR}/*.hpp)
66-
RECURSE_FILES(hpp_file_listb ${SHARED_DIR}/*.hpp)
67-
RECURSE_FILES(cpp_file_list ${SOURCE_DIR}/*.cpp)
68-
RECURSE_FILES(c_file_list ${SOURCE_DIR}/*.c)
84+
recurse_files(cpp_file_list ${SOURCE_DIR}/*.cpp)
85+
recurse_files(c_file_list ${SOURCE_DIR}/*.c)
86+
87+
recurse_files(inline_hook_c ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.c)
88+
recurse_files(inline_hook_cpp ${EXTERN_DIR}/includes/beatsaber-hook/shared/inline-hook/*.cpp)
6989
7090
# add all src files to compile
7191
add_library(
72-
${COMPILE_ID}
73-
SHARED
74-
${h_file_lista}
75-
${h_file_listb}
76-
${hpp_file_lista}
77-
${hpp_file_listb}
78-
${cpp_file_list}
79-
${c_file_list}
92+
${COMPILE_ID} SHARED ${cpp_file_list} ${c_file_list} ${inline_hook_c} ${inline_hook_cpp}
8093
)
8194
82-
# Add any assets
83-
add_assets(assets_${COMPILE_ID} STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp)
84-
85-
# get the vcpkg dir from env variables
86-
if(EXISTS $ENV{VCPKG_ROOT})
87-
set(VCPKG_ROOT $ENV{VCPKG_ROOT})
88-
else()
89-
MESSAGE(ERROR "Please define the environment variable VCPKG_ROOT with the root to your vcpkg install!")
90-
endif()
91-
92-
target_include_directories(${COMPILE_ID} PRIVATE .)
93-
9495
# add src dir as include dir
9596
target_include_directories(${COMPILE_ID} PRIVATE ${SOURCE_DIR})
9697
# add include dir as include dir
9798
target_include_directories(${COMPILE_ID} PRIVATE ${INCLUDE_DIR})
9899
# add shared dir as include dir
99100
target_include_directories(${COMPILE_ID} PUBLIC ${SHARED_DIR})
100-
# codegen includes
101-
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/${CODEGEN_ID}/include)
102101
# chatplex-sdk-bs includes
103102
target_include_directories(${COMPILE_ID} PRIVATE ${EXTERN_DIR}/includes/chatplex-sdk-bs/shared)
104103
105-
target_link_libraries(${COMPILE_ID} PRIVATE -llog)
106-
target_link_libraries(${COMPILE_ID} PRIVATE assets_${COMPILE_ID})
104+
# Add any assets
105+
add_assets(${COMPILE_ID}-assets STATIC ${CMAKE_CURRENT_LIST_DIR}/assets ${INCLUDE_DIR}/assets.hpp)
106+
target_link_libraries(${COMPILE_ID} PRIVATE -llog -lz ${COMPILE_ID}-assets)
107107
108108
# add extern stuff like libs and other includes
109109
include(extern.cmake)
110110
111111
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
112-
COMMAND ${CMAKE_STRIP} -d --strip-all
113-
"lib${COMPILE_ID}.so" -o "stripped_lib${COMPILE_ID}.so"
114-
COMMENT "Strip debug symbols done on final binary.")
112+
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all
113+
"lib${COMPILE_ID}.so" -o "stripped_lib${COMPILE_ID}.so"
114+
COMMENT "Strip debug symbols done on final binary.")
115115
116116
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
117117
COMMAND ${CMAKE_COMMAND} -E make_directory debug
118118
COMMENT "Make directory for debug symbols"
119119
)
120120
121121
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
122-
COMMAND ${CMAKE_COMMAND} -E rename lib${COMPILE_ID}.so debug/lib${COMPILE_ID}.so
123-
COMMENT "Rename the lib to debug_ since it has debug symbols"
124-
)
122+
COMMAND ${CMAKE_COMMAND} -E rename lib${COMPILE_ID}.so debug/lib${COMPILE_ID}.so
123+
COMMENT "Rename the lib to debug_ since it has debug symbols"
124+
)
125125
126-
# strip debug symbols from the .so and all dependencies
127126
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
128-
COMMAND ${CMAKE_COMMAND} -E rename stripped_lib${COMPILE_ID}.so lib${COMPILE_ID}.so
129-
COMMENT "Rename the stripped lib to regular"
130-
)
131-
foreach(so_file ${so_list})
132-
cmake_path(GET so_file FILENAME file)
127+
COMMAND ${CMAKE_COMMAND} -E rename stripped_lib${COMPILE_ID}.so lib${COMPILE_ID}.so
128+
COMMENT "Rename the stripped lib to regular"
129+
)
133130
134-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
135-
COMMAND ${CMAKE_COMMAND} -E copy ${so_file} debug/${file}
136-
COMMENT "Copy so files for ndk stack"
137-
)
131+
foreach(so_file ${so_list})
132+
cmake_path(GET so_file FILENAME file)
138133
139-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
140-
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all ${so_file} -o ${file}
141-
COMMENT "Strip debug symbols from the dependencies")
142-
endforeach()
134+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
135+
COMMAND ${CMAKE_COMMAND} -E copy ${so_file} debug/${file}
136+
COMMENT "Copy so files for ndk stack"
137+
)
143138
144-
foreach(a_file ${a_list})
145-
cmake_path(GET a_file FILENAME file)
139+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
140+
COMMAND ${CMAKE_STRIP} -g -S -d --strip-all ${so_file} -o ${file}
141+
COMMENT "Strip debug symbols from the dependencies")
142+
endforeach()
146143
147-
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
148-
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
149-
COMMENT "Copy a files for ndk stack")
150-
endforeach()
144+
foreach(a_file ${a_list})
145+
cmake_path(GET a_file FILENAME file)
146+
147+
add_custom_command(TARGET ${COMPILE_ID} POST_BUILD
148+
COMMAND ${CMAKE_COMMAND} -E copy ${a_file} debug/${file}
149+
COMMENT "Copy a files for ndk stack")
150+
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 0x2885bc7
5+
#define GIT_MODIFIED 1

mod.json

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,47 @@
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-MenuMusic",
45
"id": "qbeatsaberplus-menumusic",
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": "^1.1.12",
25+
"version": "^1.1.20",
2026
"id": "songcore",
21-
"downloadIfMissing": "https://github.com/raineio/Quest-SongCore/releases/download/v1.1.15/SongCore.qmod"
27+
"downloadIfMissing": "https://github.com/raineaeternal/Quest-SongCore/releases/download/v1.1.20/SongCore.qmod"
2228
},
2329
{
24-
"version": "^3.6.3",
25-
"id": "paper",
26-
"downloadIfMissing": "https://github.com/Fernthedev/paperlog/releases/download/v3.6.4/paperlog.qmod"
30+
"version": "^4.6.1",
31+
"id": "paper2_scotland2",
32+
"downloadIfMissing": "https://github.com/Fernthedev/paperlog/releases/download/v4.6.2/paper2_scotland2.qmod"
2733
},
2834
{
29-
"version": "^6.3.2",
35+
"version": "^6.4.0",
3036
"id": "chatplex-sdk-bs",
31-
"downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.3.2/ChatPlexSDK-BS.qmod"
37+
"downloadIfMissing": "https://github.com/hardcpp/QuestChatPlexSDK-BS/releases/download/v6.4.0/ChatPlexSDK-BS.qmod"
3238
}
3339
],
34-
"modFiles": [],
35-
"lateModFiles": [
40+
"modFiles": [
3641
"libqbeatsaberplus-menumusic.so"
3742
],
38-
"libraryFiles": [
39-
"libbeatsaber-hook_5_1_9.so"
40-
],
43+
"lateModFiles": [],
44+
"libraryFiles": [],
4145
"fileCopies": [],
4246
"copyExtensions": []
4347
}

0 commit comments

Comments
 (0)