hocclk: build system changes

- update C++ version to GNU23, change how build scripts behave and more
This commit is contained in:
souldbminersmwc
2026-04-02 16:59:11 -04:00
parent 485aa83de5
commit cce2069a32
6 changed files with 10 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ make -j$CORES
popd > /dev/null
mkdir -p "$DIST_DIR/atmosphere/contents/$TITLE_ID/flags"
cp -vf "$ROOT_DIR/sysmodule/out/horizon-oc.nsp" "$DIST_DIR/atmosphere/contents/$TITLE_ID/exefs.nsp"
cp -vf "$ROOT_DIR/sysmodule/out/hoc-clk.nsp" "$DIST_DIR/atmosphere/contents/$TITLE_ID/exefs.nsp"
>"$DIST_DIR/atmosphere/contents/$TITLE_ID/flags/boot2.flag"
cp -vf "$ROOT_DIR/sysmodule/toolbox.json" "$DIST_DIR/atmosphere/contents/$TITLE_ID/toolbox.json"

View File

@@ -64,7 +64,7 @@ CFLAGS += -DUI_OVERRIDE_PATH="\"$(UI_OVERRIDE_PATH)\""
#CFLAGS += -DNO_FSTREAM_DIRECTIVE=$(NO_FSTREAM_DIRECTIVE)
CXXFLAGS := $(CFLAGS) -fno-exceptions -std=gnu++20
CXXFLAGS := $(CFLAGS) -fno-exceptions -std=gnu++23
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)

View File

@@ -17,7 +17,8 @@ include $(DEVKITPRO)/libnx/switch_rules
# INCLUDES is a list of directories containing header files
# EXEFS_SRC is the optional input directory containing data copied into exefs, if anything this normally should only contain "main.npdm".
#---------------------------------------------------------------------------------
TARGET := horizon-oc
TARGET := hoc-clk
CONFIG_DIR := horizon-oc
BUILD := build
OUTDIR := out
RESOURCES := res
@@ -35,7 +36,7 @@ TARGET_VERSION := $(shell git describe --dirty --always --tags)
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
DEFINES := -DDISABLE_IPC -DTARGET="\"$(TARGET)\"" -DTARGET_VERSION="\"$(TARGET_VERSION)\""
DEFINES := -DDISABLE_IPC -DTARGET="\"$(TARGET)\"" -DTARGET_VERSION="\"$(TARGET_VERSION)\"" -DCONFIG_DIR="\"$(CONFIG_DIR)\""
ARCH := -march=armv8-a+crc+crypto -mtune=cortex-a57 -mtp=soft -fPIE
@@ -44,7 +45,7 @@ CFLAGS := -g -Wall -Os -ffunction-sections \
CFLAGS += $(INCLUDE) -D__SWITCH__
CXXFLAGS := $(CFLAGS) -fno-rtti -std=gnu++17
CXXFLAGS := $(CFLAGS) -fno-rtti -std=gnu++23
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)

View File

@@ -257,8 +257,8 @@ namespace config {
std::vector<std::string> keys;
std::vector<std::string> values;
keys.reserve(HocClkProfile_EnumMax * HocClkModule_EnumMax);
values.reserve(HocClkProfile_EnumMax * HocClkModule_EnumMax);
keys.reserve(+HocClkProfile_EnumMax * +HocClkModule_EnumMax);
values.reserve(+HocClkProfile_EnumMax * +HocClkModule_EnumMax);
std::uint32_t* mhz = &profiles->mhz[0];

View File

@@ -34,7 +34,7 @@
#include <cstdarg>
#include <hocclk.h>
#define FILE_CONFIG_DIR "/config/" TARGET
#define FILE_CONFIG_DIR "/config/" CONFIG_DIR
#define FILE_FLAG_CHECK_INTERVAL_NS (10000ULL * 1000000000ULL)
#define FILE_CONTEXT_CSV_PATH FILE_CONFIG_DIR "/context.csv"
#define FILE_LOG_FLAG_PATH FILE_CONFIG_DIR "/log.flag"

View File

@@ -88,7 +88,7 @@ namespace integrations {
bool GetRETROSuperStatus() {
struct stat st = {0};
return stat("sdmc:/config/horizon-oc/retro.flag", &st) == 0;
return stat("sdmc:/config/horizon-oc/retro.flag", &st) == 0; // TODO: unhardcode this
}
void LoadSaltyNX() {