Skip to content

Commit f9219f6

Browse files
committed
refactor: Split codebase into sub-files
1 parent 0847d25 commit f9219f6

File tree

10 files changed

+1701
-1618
lines changed

10 files changed

+1701
-1618
lines changed

CMakeLists.txt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,26 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
66

77
project(BetterInputs VERSION 1.0.0)
88

9-
add_library(${PROJECT_NAME} SHARED
10-
src/main.cpp
9+
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
10+
11+
file(GLOB_RECURSE SRC_FILES
12+
"${SRC_DIR}/hooks/*.cpp"
13+
)
14+
set(SRC_FILES ${SRC_FILES}
15+
${SRC_DIR}/BetterTextInputNode.cpp
1116
)
1217

18+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
19+
set(SRC_FILES ${SRC_FILES} src/macos.mm)
20+
set_source_files_properties(src/macos.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
21+
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
22+
set(SRC_FILES ${SRC_FILES} src/windows.cpp)
23+
else()
24+
message(FATAL_ERROR "Unsupported mod platform!")
25+
endif()
26+
27+
add_library(${PROJECT_NAME} MODULE "${SRC_FILES}")
28+
1329
if (NOT DEFINED ENV{GEODE_SDK})
1430
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
1531
else()

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"win": "2.2074",
55
"mac": "2.2074"
66
},
7-
"version": "v4.2.0-beta.3",
7+
"version": "v4.2.0-beta.4",
88
"id": "spaghettdev.betterinputs",
99
"name": "BetterInputs",
1010
"developer": "SpaghettDev",

0 commit comments

Comments
 (0)