Improved cmake info output
This commit is contained in:
parent
f8eba73736
commit
2f3e9941e2
@ -3,7 +3,6 @@ set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/components")
|
||||
|
||||
macro(rg_setup_compile_options)
|
||||
set(RG_TARGET "RG_TARGET_${RG_BUILD_TARGET}")
|
||||
message("Target: ${RG_TARGET}")
|
||||
|
||||
component_compile_options(
|
||||
-D${RG_TARGET}
|
||||
|
||||
@ -4,7 +4,8 @@
|
||||
# Required: SDL2
|
||||
|
||||
CC="gcc"
|
||||
CFLAGS="-no-pie -DRG_TARGET_SDL2 -DRETRO_GO -DCJSON_HIDE_SYMBOLS -DSDL_MAIN_HANDLED=1 -Dapp_main=SDL_Main $(sdl2-config --cflags)"
|
||||
# BUILD_INFO="RG:$(git describe) / SDL:$(sdl2-config --version)"
|
||||
CFLAGS="-no-pie -DRG_TARGET_SDL2 -DRETRO_GO -DCJSON_HIDE_SYMBOLS -DSDL_MAIN_HANDLED=1 -DRG_BUILD_INFO=\"SDL2\" -Dapp_main=SDL_Main $(sdl2-config --cflags)"
|
||||
INCLUDES="-Icomponents/retro-go -Icomponents/retro-go/libs/cJSON -Icomponents/retro-go/libs/lodepng"
|
||||
SRCFILES="components/retro-go/*.c components/retro-go/drivers/audio/*.c components/retro-go/fonts/*.c
|
||||
components/retro-go/libs/cJSON/*.c components/retro-go/libs/lodepng/*.c"
|
||||
@ -26,6 +27,7 @@ $CC $CFLAGS $INCLUDES \
|
||||
-Iretro-core/components/nofrendo \
|
||||
-Iretro-core/components/pce-go \
|
||||
-Iretro-core/components/snes9x \
|
||||
-Iretro-core/components/snes9x/src \
|
||||
-Iretro-core/components/smsplus \
|
||||
-Iretro-core/main \
|
||||
$SRCFILES \
|
||||
@ -38,7 +40,7 @@ $CC $CFLAGS $INCLUDES \
|
||||
retro-core/components/nofrendo/nes/*.c \
|
||||
retro-core/components/nofrendo/*.c \
|
||||
retro-core/components/pce-go/*.c \
|
||||
retro-core/components/snes9x/*.c \
|
||||
retro-core/components/snes9x/src/*.c \
|
||||
retro-core/components/smsplus/*.c \
|
||||
retro-core/components/smsplus/cpu/*.c \
|
||||
retro-core/components/smsplus/sound/*.c \
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
set(COMPONENT_SRCDIRS ". drivers/audio fonts libs/netplay libs/lodepng")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ". libs/netplay libs/lodepng")
|
||||
|
||||
message(STATUS "ESP-IDF version: ${IDF_VER}")
|
||||
|
||||
if (IDF_VERSION_MAJOR EQUAL 5)
|
||||
set(COMPONENT_REQUIRES "spi_flash fatfs app_update json nvs_flash esp_adc esp_timer esp_psram esp_wifi esp_http_client")
|
||||
else() # esp-idf 4.1 - 4.4
|
||||
@ -36,19 +34,25 @@ if(RG_ENABLE_PROFILING)
|
||||
component_compile_options(-DRG_ENABLE_PROFILING)
|
||||
endif()
|
||||
|
||||
if(RG_BUILD_VERSION)
|
||||
component_compile_options(-DRG_BUILD_VERSION="${RG_BUILD_VERSION}")
|
||||
if(RG_PROJECT_VER)
|
||||
component_compile_options(-DRG_PROJECT_VER="${RG_PROJECT_VER}")
|
||||
endif()
|
||||
|
||||
if(RG_BUILD_RELEASE)
|
||||
component_compile_options(-DRG_BUILD_RELEASE=1)
|
||||
endif()
|
||||
|
||||
set(RG_TARGET "RG_TARGET_${RG_BUILD_TARGET}")
|
||||
string(TIMESTAMP RG_TIME "%s")
|
||||
if(RG_BUILD_TARGET)
|
||||
component_compile_options(-D${RG_BUILD_TARGET})
|
||||
endif()
|
||||
|
||||
message(STATUS "Target: ${RG_TARGET}")
|
||||
message(STATUS "Time: ${RG_TIME}")
|
||||
set(RG_BUILD_INFO "${RG_BUILD_TARGET}-${RG_BUILD_RELEASE} GIT:${PROJECT_VER} SDK:${IDF_VER}")
|
||||
string(TIMESTAMP RG_BUILD_TIME "%s")
|
||||
|
||||
component_compile_options(-DRG_BUILD_TIME=${RG_TIME})
|
||||
component_compile_options(-D${RG_TARGET})
|
||||
component_compile_options(-DRG_PROJECT_APP="${RG_PROJECT_APP}")
|
||||
component_compile_options(-DRG_BUILD_INFO="${RG_BUILD_INFO}")
|
||||
component_compile_options(-DRG_BUILD_TIME=${RG_BUILD_TIME})
|
||||
|
||||
message(STATUS "RG_PROJECT_APP: ${RG_PROJECT_APP}")
|
||||
message(STATUS "RG_PROJECT_VER: ${RG_PROJECT_VER}")
|
||||
message(STATUS "RG_BUILD_INFO: ${RG_BUILD_INFO}")
|
||||
|
||||
@ -24,6 +24,48 @@
|
||||
#define RG_TARGET_ODROID_GO
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_NAME
|
||||
#define RG_PROJECT_NAME "Retro-Go"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_WEBSITE
|
||||
#define RG_PROJECT_WEBSITE "https://github.com/ducalex/retro-go"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_GITHUB_RELEASES
|
||||
#define RG_PROJECT_GITHUB_RELEASES "https://api.github.com/repos/ducalex/retro-go/releases"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_CREDITS
|
||||
#define RG_PROJECT_CREDITS \
|
||||
"Retro-Go: ducalex\n"
|
||||
// TODO: Decide which additional credits should be included here?
|
||||
// Maybe the main author for each emulator? Or should that credit be only when seeing `about` inside said app?
|
||||
// What about libraries and fonts (lodepng, etc)?
|
||||
// What about targets/ports? Should we have a RG_TARGET_AUTHOR to append here?
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_APP
|
||||
#define RG_PROJECT_APP "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_VER
|
||||
#define RG_PROJECT_VER "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_INFO
|
||||
#define RG_BUILD_INFO "(none)"
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_TIME
|
||||
// 2020-01-31 00:00:00, first retro-go commit :)
|
||||
#define RG_BUILD_TIME 1580446800
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_DATE
|
||||
#define RG_BUILD_DATE __DATE__ " " __TIME__
|
||||
#endif
|
||||
|
||||
// #ifndef RG_ENABLE_NETPLAY
|
||||
// #define RG_ENABLE_NETPLAY 0
|
||||
// #endif
|
||||
@ -49,52 +91,6 @@
|
||||
#define RG_PATH_MAX 255
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_NAME
|
||||
#define RG_PROJECT_NAME "Retro-Go"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_APP
|
||||
#define RG_PROJECT_APP "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_VERSION
|
||||
#define RG_PROJECT_VERSION RG_BUILD_VERSION
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_CREDITS
|
||||
#define RG_PROJECT_CREDITS \
|
||||
"Retro-Go: ducalex\n"
|
||||
// TODO: Decide which additional credits should be included here?
|
||||
// Maybe the main author for each emulator? Or should that credit be only when seeing `about` inside said app?
|
||||
// What about libraries and fonts (lodepng, etc)?
|
||||
// What about targets/ports? Should we have a RG_TARGET_AUTHOR to append here?
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_WEBSITE
|
||||
#define RG_PROJECT_WEBSITE "https://github.com/ducalex/retro-go"
|
||||
#endif
|
||||
|
||||
#ifndef RG_PROJECT_RELEASES_URL
|
||||
#define RG_PROJECT_RELEASES_URL "https://api.github.com/repos/ducalex/retro-go/releases"
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_VERSION
|
||||
#define RG_BUILD_VERSION "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_TIME
|
||||
// 2020-01-31 00:00:00, first retro-go commit :)
|
||||
#define RG_BUILD_TIME 1580446800
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_DATE
|
||||
#define RG_BUILD_DATE __DATE__ " " __TIME__
|
||||
#endif
|
||||
|
||||
#ifndef RG_BUILD_TOOL
|
||||
#define RG_BUILD_TOOL "unknown"
|
||||
#endif
|
||||
|
||||
#ifndef RG_RECOVERY_BTN
|
||||
#define RG_RECOVERY_BTN RG_KEY_ANY
|
||||
#endif
|
||||
|
||||
@ -345,9 +345,9 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
|
||||
|
||||
app = (rg_app_t){
|
||||
.name = RG_PROJECT_APP,
|
||||
.version = RG_PROJECT_VERSION,
|
||||
.version = RG_PROJECT_VER,
|
||||
.buildDate = RG_BUILD_DATE,
|
||||
.buildTool = RG_BUILD_TOOL,
|
||||
.buildInfo = RG_BUILD_INFO,
|
||||
.configNs = RG_PROJECT_APP,
|
||||
.bootArgs = NULL,
|
||||
.bootFlags = 0,
|
||||
@ -376,11 +376,6 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
|
||||
platform_init();
|
||||
|
||||
#if defined(ESP_PLATFORM)
|
||||
const esp_app_desc_t *esp_app = esp_ota_get_app_description();
|
||||
snprintf(app.name, sizeof(app.name), "%s", esp_app->project_name);
|
||||
snprintf(app.version, sizeof(app.version), "%s", esp_app->version);
|
||||
snprintf(app.buildDate, sizeof(app.buildDate), "%s %s", esp_app->date, esp_app->time);
|
||||
snprintf(app.buildTool, sizeof(app.buildTool), "%s", esp_app->idf_ver);
|
||||
esp_reset_reason_t r_reason = esp_reset_reason();
|
||||
if (r_reason == ESP_RST_PANIC || r_reason == ESP_RST_TASK_WDT || r_reason == ESP_RST_INT_WDT)
|
||||
app.bootType = RG_RST_PANIC;
|
||||
@ -388,10 +383,6 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
|
||||
app.bootType = RG_RST_RESTART;
|
||||
tasks[0] = (rg_task_t){.handle = xTaskGetCurrentTaskHandle(), .name = "main"};
|
||||
#elif defined(RG_TARGET_SDL2)
|
||||
SDL_version version;
|
||||
SDL_GetVersion(&version);
|
||||
snprintf(app.buildTool, sizeof(app.buildTool), "SDL2 %d.%d.%d / CC %s", version.major,
|
||||
version.minor, version.patch, __VERSION__);
|
||||
tasks[0] = (rg_task_t){.handle = SDL_ThreadID(), .name = "main"};
|
||||
#endif
|
||||
|
||||
@ -443,7 +434,7 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
|
||||
app.bootFlags = rg_settings_get_number(NS_BOOT, SETTING_BOOT_FLAGS, 0);
|
||||
app.saveSlot = (app.bootFlags & RG_BOOT_SLOT_MASK) >> 4;
|
||||
app.romPath = app.bootArgs;
|
||||
app.isLauncher = strcmp(app.name, "launcher") == 0; // Might be overriden after init
|
||||
app.isLauncher = strcmp(app.name, RG_APP_LAUNCHER) == 0; // Might be overriden after init
|
||||
app.indicatorsMask = rg_settings_get_number(NS_GLOBAL, SETTING_INDICATOR_MASK, app.indicatorsMask);
|
||||
|
||||
rg_display_init();
|
||||
@ -963,7 +954,7 @@ bool rg_system_save_trace(const char *filename, bool panic_trace)
|
||||
fprintf(fp, "Application: %s (%s)\n", app.name, app.configNs);
|
||||
fprintf(fp, "Version: %s\n", app.version);
|
||||
fprintf(fp, "Build date: %s\n", app.buildDate);
|
||||
fprintf(fp, "Toolchain: %s\n", app.buildTool);
|
||||
fprintf(fp, "Build info: %s\n", app.buildInfo);
|
||||
fprintf(fp, "Total memory: %d + %d\n", stats->totalMemoryInt, stats->totalMemoryExt);
|
||||
fprintf(fp, "Free memory: %d + %d\n", stats->freeMemoryInt, stats->freeMemoryExt);
|
||||
fprintf(fp, "Free block: %d + %d\n", stats->freeBlockInt, stats->freeBlockExt);
|
||||
|
||||
@ -168,10 +168,10 @@ typedef struct
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[32];
|
||||
char version[32];
|
||||
char buildDate[32];
|
||||
char buildTool[32];
|
||||
const char *name;
|
||||
const char *version;
|
||||
const char *buildDate;
|
||||
const char *buildInfo;
|
||||
const char *configNs;
|
||||
const char *bootArgs;
|
||||
uint32_t bootFlags;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
set(COMPONENT_SRCDIRS "src/bus src/cpus/M68K src/cpus/Z80 src/io src/savestate src/sound src/vdp")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS "src/bus src/cpus/M68K src/cpus/Z80 src/io src/savestate src/sound src/vdp")
|
||||
set(COMPONENT_ADD_INCLUDEDIRS ". src/bus src/cpus/M68K src/cpus/Z80 src/io src/savestate src/sound src/vdp")
|
||||
set(COMPONENT_REQUIRES "retro-go")
|
||||
register_component()
|
||||
rg_setup_compile_options(-O2 -Wno-incompatible-pointer-types)
|
||||
|
||||
@ -165,7 +165,7 @@ static rg_gui_event_t view_release_cb(rg_gui_option_t *option, rg_gui_event_t ev
|
||||
|
||||
void updater_show_dialog(void)
|
||||
{
|
||||
cJSON *releases_json = fetch_json(RG_PROJECT_RELEASES_URL);
|
||||
cJSON *releases_json = fetch_json(RG_PROJECT_GITHUB_RELEASES);
|
||||
if (!releases_json)
|
||||
{
|
||||
rg_gui_alert("Connection failed", "Make sure that you are online!");
|
||||
|
||||
@ -134,9 +134,9 @@ def build_app(app, device_type, with_profiling=False, no_networking=False, is_re
|
||||
# To do: clean up if any of the flags changed since last build
|
||||
print("Building app '%s'" % app)
|
||||
args = [IDF_PY, "app"]
|
||||
args.append(f"-DRG_BUILD_APP={app}")
|
||||
args.append(f"-DRG_BUILD_VERSION={PROJECT_VER}")
|
||||
args.append(f"-DRG_BUILD_TARGET={re.sub(r'[^A-Z0-9]', '_', device_type.upper())}")
|
||||
args.append(f"-DRG_PROJECT_APP={app}")
|
||||
args.append(f"-DRG_PROJECT_VER={PROJECT_VER}")
|
||||
args.append(f"-DRG_BUILD_TARGET=RG_TARGET_{re.sub(r'[^A-Z0-9]', '_', device_type.upper())}")
|
||||
args.append(f"-DRG_BUILD_RELEASE={1 if is_release else 0}")
|
||||
args.append(f"-DRG_ENABLE_PROFILING={1 if with_profiling else 0}")
|
||||
args.append(f"-DRG_ENABLE_NETWORKING={0 if no_networking else 1}")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user