Skip to content

Commit 29c4fd9

Browse files
committed
revert modules
1 parent 79ec8a1 commit 29c4fd9

14 files changed

Lines changed: 42 additions & 79 deletions

CMakeLists.txt

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
cmake_minimum_required(VERSION 3.26)
2-
1+
cmake_minimum_required(VERSION 3.21)
32
set(CMAKE_CXX_STANDARD 23)
43
set(CMAKE_CXX_STANDARD_REQUIRED ON)
5-
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
6-
74
if("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
85
set(CMAKE_OSX_ARCHITECTURES "arm64")
96
else()
107
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
118
endif()
9+
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1210

1311
project(HorribleIdeas VERSION 1.0.0)
1412

15-
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
16-
1713
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS src/*.cpp)
18-
file(GLOB_RECURSE MODULES CONFIGURE_DEPENDS src/*.cppm)
19-
20-
add_library(${PROJECT_NAME} SHARED)
21-
22-
target_sources(${PROJECT_NAME}
23-
PRIVATE ${SOURCES}
24-
PUBLIC FILE_SET cxx_modules TYPE CXX_MODULES FILES ${MODULES}
25-
)
14+
add_library(${PROJECT_NAME} SHARED ${SOURCES})
2615

2716
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/include)
2817

@@ -36,8 +25,6 @@ else()
3625
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
3726
endif()
3827

39-
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
4028
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
41-
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
4229

4330
setup_geode_mod(${PROJECT_NAME})

include/Option.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace horrible {
2828
Option() = default; // Default constructor
2929

3030
// Constructor
31-
inline Option(
31+
Option(
3232
std::string id,
3333
std::string name,
3434
std::string description,

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include <Utils.hpp>
22

3+
#include <menu/OptionMenuButton.hpp>
4+
#include <menu/SettingV3.hpp>
5+
36
#include <ranges>
47

58
#include <Geode/modify/PlayLayer.hpp>
@@ -8,9 +11,6 @@
811

912
using namespace horrible::prelude;
1013

11-
import OptionMenuButton;
12-
import SettingV3;
13-
1414
inline static std::vector<Hook*> safeModeHooks;
1515
inline static std::vector<Hook*> floatingBtnHooks;
1616

@@ -41,7 +41,7 @@ inline static std::vector<Hook*> floatingBtnHooks;
4141
}; \
4242
}
4343

44-
$on_mod(Loaded) {
44+
$on_game(Loaded) {
4545
(void)horribleMod->registerCustomSettingType("menu", &HorribleSettingV3::parse);
4646

4747
if (auto fb = OptionMenuButton::get()) OverlayManager::get()->addChild(fb);
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
module;
1+
#pragma once
22

33
#include <Geode/Geode.hpp>
44

55
using namespace geode::prelude;
66

7-
export module OptionCategoryItem;
8-
97
// Event for option toggles
10-
export struct CategoryEvent final : Event<CategoryEvent, bool(std::string_view, bool)> {
8+
struct CategoryEvent final : Event<CategoryEvent, bool(std::string_view, bool)> {
119
using Event::Event;
1210
};
1311

14-
export class OptionCategoryItem final : public CCMenu {
12+
class OptionCategoryItem final : public CCMenu {
1513
private:
1614
class Impl;
1715
std::unique_ptr<Impl> m_impl;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module;
1+
#pragma once
22

33
#include <Utils.hpp>
44

@@ -7,14 +7,12 @@ module;
77
using namespace geode::prelude;
88
using namespace horrible;
99

10-
export module OptionItem;
11-
1210
// Event for pin toggles
13-
export struct PinEvent final : Event<PinEvent, bool()> {
11+
struct PinEvent final : Event<PinEvent, bool()> {
1412
using Event::Event;
1513
};
1614

17-
export class OptionItem final : public CCMenu {
15+
class OptionItem final : public CCMenu {
1816
private:
1917
class Impl;
2018
std::unique_ptr<Impl> m_impl;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module;
1+
#pragma once
2+
3+
#include "OptionCategoryItem.hpp"
24

35
#include <Utils.hpp>
46

@@ -7,9 +9,7 @@ module;
79
using namespace geode::prelude;
810
using namespace horrible;
911

10-
export module OptionMenu;
11-
12-
export class OptionMenu final : public Popup {
12+
class OptionMenu final : public Popup {
1313
private:
1414
class Impl;
1515
std::unique_ptr<Impl> m_impl;
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
module;
1+
#pragma once
22

33
#include <Geode/Geode.hpp>
44

55
using namespace geode::prelude;
66

7-
export module OptionMenuButton;
8-
9-
export class OptionMenuButton final : public CCLayer {
7+
class OptionMenuButton final : public CCLayer {
108
private:
119
class Impl;
1210
std::unique_ptr<Impl> m_impl;
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
module;
1+
#pragma once
22

33
#include <Geode/Geode.hpp>
44

55
#include <Geode/loader/SettingV3.hpp>
66

77
using namespace geode::prelude;
88

9-
export module SettingV3;
10-
11-
export class HorribleSettingV3 final : public SettingV3 {
9+
class HorribleSettingV3 final : public SettingV3 {
1210
public:
1311
static Result<std::shared_ptr<SettingV3>> parse(
1412
std::string key,
@@ -25,7 +23,7 @@ export class HorribleSettingV3 final : public SettingV3 {
2523
SettingNodeV3* createNode(float width) override;
2624
};
2725

28-
export class HorribleSettingNodeV3 final : public SettingNodeV3 {
26+
class HorribleSettingNodeV3 final : public SettingNodeV3 {
2927
private:
3028
class Impl;
3129
std::unique_ptr<Impl> m_impl;

src/menu/src/OptionCategoryItem.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
module;
2-
3-
#include <Utils.hpp>
1+
#include "../OptionCategoryItem.hpp"
42

53
#include <Geode/Geode.hpp>
4+
#include <Utils.hpp>
65

76
using namespace geode::prelude;
87
using namespace horrible::prelude;
98

10-
module OptionCategoryItem;
11-
129
class OptionCategoryItem::Impl final {
1310
public:
1411
std::string category = ""; // The category name

src/menu/src/OptionItem.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module;
1+
#include "../OptionItem.hpp"
22

33
#include <Utils.hpp>
44

@@ -7,8 +7,6 @@ module;
77
using namespace geode::prelude;
88
using namespace horrible::prelude;
99

10-
module OptionItem;
11-
1210
class OptionItem::Impl final {
1311
public:
1412
bool compatible = false; // If this option is compatible with the current platform

0 commit comments

Comments
 (0)