From 1be7bfc2e21f9574a8b7da9ccf1573e96e7230e6 Mon Sep 17 00:00:00 2001 From: Memotech Bill <64212746+Memotech-Bill@users.noreply.github.com> Date: Sat, 13 Apr 2024 16:10:37 +0100 Subject: [PATCH] Select OS specific version of Directory Traversal Routines --- src/memu/CMakeLists.txt | 353 +++++++++++++++++++++------------------- 1 file changed, 182 insertions(+), 171 deletions(-) diff --git a/src/memu/CMakeLists.txt b/src/memu/CMakeLists.txt index 6a015c4..11a43fb 100644 --- a/src/memu/CMakeLists.txt +++ b/src/memu/CMakeLists.txt @@ -48,44 +48,44 @@ if("${TARGET}" STREQUAL "Pico") elseif("${TARGET}" STREQUAL "FBuf") set (fbuf_src - ${CMAKE_CURRENT_LIST_DIR}/cfx2.c - ${CMAKE_CURRENT_LIST_DIR}/common.c - ${CMAKE_CURRENT_LIST_DIR}/config.c - ${CMAKE_CURRENT_LIST_DIR}/cpm.c - ${CMAKE_CURRENT_LIST_DIR}/ctc.c - ${CMAKE_CURRENT_LIST_DIR}/dart.c - ${CMAKE_CURRENT_LIST_DIR}/diag.c - ${CMAKE_CURRENT_LIST_DIR}/dirmap.c - ${CMAKE_CURRENT_LIST_DIR}/dirt_unix.c - ${CMAKE_CURRENT_LIST_DIR}/dis.c - ${CMAKE_CURRENT_LIST_DIR}/joy_lin.c - ${CMAKE_CURRENT_LIST_DIR}/kbd2.c - ${CMAKE_CURRENT_LIST_DIR}/main.c - ${CMAKE_CURRENT_LIST_DIR}/mem.c - ${CMAKE_CURRENT_LIST_DIR}/memu.c - ${CMAKE_CURRENT_LIST_DIR}/mon.c - ${CMAKE_CURRENT_LIST_DIR}/monprom.c - ${CMAKE_CURRENT_LIST_DIR}/nfx.c - ${CMAKE_CURRENT_LIST_DIR}/printer.c - ${CMAKE_CURRENT_LIST_DIR}/rom_os.c - ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c - ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c - ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c - ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c - ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c - ${CMAKE_CURRENT_LIST_DIR}/sid.c - ${CMAKE_CURRENT_LIST_DIR}/snd.c - ${CMAKE_CURRENT_LIST_DIR}/spec.c - ${CMAKE_CURRENT_LIST_DIR}/tape.c - ${CMAKE_CURRENT_LIST_DIR}/txtwin.c - ${CMAKE_CURRENT_LIST_DIR}/ui.c - ${CMAKE_CURRENT_LIST_DIR}/vdeb.c - ${CMAKE_CURRENT_LIST_DIR}/vga.c - ${CMAKE_CURRENT_LIST_DIR}/vid.c - ${CMAKE_CURRENT_LIST_DIR}/win.c - ${CMAKE_CURRENT_LIST_DIR}/win_fb.c - ) - + ${CMAKE_CURRENT_LIST_DIR}/cfx2.c + ${CMAKE_CURRENT_LIST_DIR}/common.c + ${CMAKE_CURRENT_LIST_DIR}/config.c + ${CMAKE_CURRENT_LIST_DIR}/cpm.c + ${CMAKE_CURRENT_LIST_DIR}/ctc.c + ${CMAKE_CURRENT_LIST_DIR}/dart.c + ${CMAKE_CURRENT_LIST_DIR}/diag.c + ${CMAKE_CURRENT_LIST_DIR}/dirmap.c + ${CMAKE_CURRENT_LIST_DIR}/dirt_unix.c + ${CMAKE_CURRENT_LIST_DIR}/dis.c + ${CMAKE_CURRENT_LIST_DIR}/joy_lin.c + ${CMAKE_CURRENT_LIST_DIR}/kbd2.c + ${CMAKE_CURRENT_LIST_DIR}/main.c + ${CMAKE_CURRENT_LIST_DIR}/mem.c + ${CMAKE_CURRENT_LIST_DIR}/memu.c + ${CMAKE_CURRENT_LIST_DIR}/mon.c + ${CMAKE_CURRENT_LIST_DIR}/monprom.c + ${CMAKE_CURRENT_LIST_DIR}/nfx.c + ${CMAKE_CURRENT_LIST_DIR}/printer.c + ${CMAKE_CURRENT_LIST_DIR}/rom_os.c + ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c + ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c + ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c + ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c + ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c + ${CMAKE_CURRENT_LIST_DIR}/sid.c + ${CMAKE_CURRENT_LIST_DIR}/snd.c + ${CMAKE_CURRENT_LIST_DIR}/spec.c + ${CMAKE_CURRENT_LIST_DIR}/tape.c + ${CMAKE_CURRENT_LIST_DIR}/txtwin.c + ${CMAKE_CURRENT_LIST_DIR}/ui.c + ${CMAKE_CURRENT_LIST_DIR}/vdeb.c + ${CMAKE_CURRENT_LIST_DIR}/vga.c + ${CMAKE_CURRENT_LIST_DIR}/vid.c + ${CMAKE_CURRENT_LIST_DIR}/win.c + ${CMAKE_CURRENT_LIST_DIR}/win_fb.c + ) + if( NOT (${CMAKE_VERSION} VERSION_LESS "3.12.0")) add_library(memu_src INTERFACE) @@ -171,145 +171,156 @@ elseif("${TARGET}" STREQUAL "RPi") elseif("${TARGET}" STREQUAL "Win") set (win_src - ${CMAKE_CURRENT_LIST_DIR}/cfx2.c - ${CMAKE_CURRENT_LIST_DIR}/common.c - ${CMAKE_CURRENT_LIST_DIR}/config.c - ${CMAKE_CURRENT_LIST_DIR}/cpm.c - ${CMAKE_CURRENT_LIST_DIR}/ctc.c - ${CMAKE_CURRENT_LIST_DIR}/diag.c - ${CMAKE_CURRENT_LIST_DIR}/dirmap.c - ${CMAKE_CURRENT_LIST_DIR}/dirt_w32.c - ${CMAKE_CURRENT_LIST_DIR}/dis.c - ${CMAKE_CURRENT_LIST_DIR}/joy_w32.c - ${CMAKE_CURRENT_LIST_DIR}/kbd2.c - ${CMAKE_CURRENT_LIST_DIR}/main.c - ${CMAKE_CURRENT_LIST_DIR}/mem.c - ${CMAKE_CURRENT_LIST_DIR}/memu.c - ${CMAKE_CURRENT_LIST_DIR}/mfx.c - ${CMAKE_CURRENT_LIST_DIR}/mon.c - ${CMAKE_CURRENT_LIST_DIR}/monprom.c - ${CMAKE_CURRENT_LIST_DIR}/printer.c - ${CMAKE_CURRENT_LIST_DIR}/rom_os.c - ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c - ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c - ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c - ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c - ${CMAKE_CURRENT_LIST_DIR}/sdcard.c - ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c - ${CMAKE_CURRENT_LIST_DIR}/sid.c - ${CMAKE_CURRENT_LIST_DIR}/snd.c - ${CMAKE_CURRENT_LIST_DIR}/spec.c - ${CMAKE_CURRENT_LIST_DIR}/tape.c - ${CMAKE_CURRENT_LIST_DIR}/txtwin.c - ${CMAKE_CURRENT_LIST_DIR}/ui.c - ${CMAKE_CURRENT_LIST_DIR}/vdeb.c - ${CMAKE_CURRENT_LIST_DIR}/vdp.c - ${CMAKE_CURRENT_LIST_DIR}/vga.c - ${CMAKE_CURRENT_LIST_DIR}/vid.c - ${CMAKE_CURRENT_LIST_DIR}/win.c - ${CMAKE_CURRENT_LIST_DIR}/win_w32.c - ) - - add_library(memu_src INTERFACE) - - target_include_directories(memu_src INTERFACE - ${CMAKE_CURRENT_LIST_DIR} - ) - - target_sources(memu_src INTERFACE ${win_src}) - - elseif("${TARGET}" STREQUAL "Circle") - - add_library(memu_src INTERFACE) - - target_include_directories(memu_src INTERFACE - ${CMAKE_CURRENT_LIST_DIR} - ) + ${CMAKE_CURRENT_LIST_DIR}/cfx2.c + ${CMAKE_CURRENT_LIST_DIR}/common.c + ${CMAKE_CURRENT_LIST_DIR}/config.c + ${CMAKE_CURRENT_LIST_DIR}/cpm.c + ${CMAKE_CURRENT_LIST_DIR}/ctc.c + ${CMAKE_CURRENT_LIST_DIR}/diag.c + ${CMAKE_CURRENT_LIST_DIR}/dirmap.c + ${CMAKE_CURRENT_LIST_DIR}/dirt_w32.c + ${CMAKE_CURRENT_LIST_DIR}/dis.c + ${CMAKE_CURRENT_LIST_DIR}/joy_w32.c + ${CMAKE_CURRENT_LIST_DIR}/kbd2.c + ${CMAKE_CURRENT_LIST_DIR}/main.c + ${CMAKE_CURRENT_LIST_DIR}/mem.c + ${CMAKE_CURRENT_LIST_DIR}/memu.c + ${CMAKE_CURRENT_LIST_DIR}/mfx.c + ${CMAKE_CURRENT_LIST_DIR}/mon.c + ${CMAKE_CURRENT_LIST_DIR}/monprom.c + ${CMAKE_CURRENT_LIST_DIR}/printer.c + ${CMAKE_CURRENT_LIST_DIR}/rom_os.c + ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c + ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c + ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c + ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c + ${CMAKE_CURRENT_LIST_DIR}/sdcard.c + ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c + ${CMAKE_CURRENT_LIST_DIR}/sid.c + ${CMAKE_CURRENT_LIST_DIR}/snd.c + ${CMAKE_CURRENT_LIST_DIR}/spec.c + ${CMAKE_CURRENT_LIST_DIR}/tape.c + ${CMAKE_CURRENT_LIST_DIR}/txtwin.c + ${CMAKE_CURRENT_LIST_DIR}/ui.c + ${CMAKE_CURRENT_LIST_DIR}/vdeb.c + ${CMAKE_CURRENT_LIST_DIR}/vdp.c + ${CMAKE_CURRENT_LIST_DIR}/vga.c + ${CMAKE_CURRENT_LIST_DIR}/vid.c + ${CMAKE_CURRENT_LIST_DIR}/win.c + ${CMAKE_CURRENT_LIST_DIR}/win_w32.c + ) + + add_library(memu_src INTERFACE) + + target_include_directories(memu_src INTERFACE + ${CMAKE_CURRENT_LIST_DIR} + ) + + target_sources(memu_src INTERFACE ${win_src}) + +elseif("${TARGET}" STREQUAL "Circle") + + add_library(memu_src INTERFACE) + + target_include_directories(memu_src INTERFACE + ${CMAKE_CURRENT_LIST_DIR} + ) - target_sources(memu_src INTERFACE - ${CMAKE_CURRENT_LIST_DIR}/cfx2.c - ${CMAKE_CURRENT_LIST_DIR}/circleio.cpp - ${CMAKE_CURRENT_LIST_DIR}/common.c - ${CMAKE_CURRENT_LIST_DIR}/config.c - ${CMAKE_CURRENT_LIST_DIR}/console_cir.cpp - ${CMAKE_CURRENT_LIST_DIR}/cpm.c - ${CMAKE_CURRENT_LIST_DIR}/ctc.c - ${CMAKE_CURRENT_LIST_DIR}/diag.c - ${CMAKE_CURRENT_LIST_DIR}/dirt_ff.c - ${CMAKE_CURRENT_LIST_DIR}/dis.c - ${CMAKE_CURRENT_LIST_DIR}/ff_stdio.c - ${CMAKE_CURRENT_LIST_DIR}/gpio.c - ${CMAKE_CURRENT_LIST_DIR}/hardware.c - ${CMAKE_CURRENT_LIST_DIR}/kbd2.c - ${CMAKE_CURRENT_LIST_DIR}/mem.c - ${CMAKE_CURRENT_LIST_DIR}/memu.c - ${CMAKE_CURRENT_LIST_DIR}/misc.cpp - ${CMAKE_CURRENT_LIST_DIR}/mon.c - ${CMAKE_CURRENT_LIST_DIR}/monprom.c - ${CMAKE_CURRENT_LIST_DIR}/printer.c - ${CMAKE_CURRENT_LIST_DIR}/rom_os.c - ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c - ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c - ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c - ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c - ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c - ${CMAKE_CURRENT_LIST_DIR}/sid.c - ${CMAKE_CURRENT_LIST_DIR}/snd.c - ${CMAKE_CURRENT_LIST_DIR}/spec.c - ${CMAKE_CURRENT_LIST_DIR}/tape.c - ${CMAKE_CURRENT_LIST_DIR}/TxtRead.c - ${CMAKE_CURRENT_LIST_DIR}/txtwin.c - ${CMAKE_CURRENT_LIST_DIR}/ui.c - ${CMAKE_CURRENT_LIST_DIR}/vdeb.c - ${CMAKE_CURRENT_LIST_DIR}/vid.c - ${CMAKE_CURRENT_LIST_DIR}/vga.c - ${CMAKE_CURRENT_LIST_DIR}/win.c - ${CMAKE_CURRENT_LIST_DIR}/win_cir.c - ) + target_sources(memu_src INTERFACE + ${CMAKE_CURRENT_LIST_DIR}/cfx2.c + ${CMAKE_CURRENT_LIST_DIR}/circleio.cpp + ${CMAKE_CURRENT_LIST_DIR}/common.c + ${CMAKE_CURRENT_LIST_DIR}/config.c + ${CMAKE_CURRENT_LIST_DIR}/console_cir.cpp + ${CMAKE_CURRENT_LIST_DIR}/cpm.c + ${CMAKE_CURRENT_LIST_DIR}/ctc.c + ${CMAKE_CURRENT_LIST_DIR}/diag.c + ${CMAKE_CURRENT_LIST_DIR}/dirt_ff.c + ${CMAKE_CURRENT_LIST_DIR}/dis.c + ${CMAKE_CURRENT_LIST_DIR}/ff_stdio.c + ${CMAKE_CURRENT_LIST_DIR}/gpio.c + ${CMAKE_CURRENT_LIST_DIR}/hardware.c + ${CMAKE_CURRENT_LIST_DIR}/kbd2.c + ${CMAKE_CURRENT_LIST_DIR}/mem.c + ${CMAKE_CURRENT_LIST_DIR}/memu.c + ${CMAKE_CURRENT_LIST_DIR}/misc.cpp + ${CMAKE_CURRENT_LIST_DIR}/mon.c + ${CMAKE_CURRENT_LIST_DIR}/monprom.c + ${CMAKE_CURRENT_LIST_DIR}/printer.c + ${CMAKE_CURRENT_LIST_DIR}/rom_os.c + ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c + ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c + ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c + ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c + ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c + ${CMAKE_CURRENT_LIST_DIR}/sid.c + ${CMAKE_CURRENT_LIST_DIR}/snd.c + ${CMAKE_CURRENT_LIST_DIR}/spec.c + ${CMAKE_CURRENT_LIST_DIR}/tape.c + ${CMAKE_CURRENT_LIST_DIR}/TxtRead.c + ${CMAKE_CURRENT_LIST_DIR}/txtwin.c + ${CMAKE_CURRENT_LIST_DIR}/ui.c + ${CMAKE_CURRENT_LIST_DIR}/vdeb.c + ${CMAKE_CURRENT_LIST_DIR}/vid.c + ${CMAKE_CURRENT_LIST_DIR}/vga.c + ${CMAKE_CURRENT_LIST_DIR}/win.c + ${CMAKE_CURRENT_LIST_DIR}/win_cir.c + ) elseif("${TARGET}" STREQUAL "SDL") - + set (sdl_src - ${CMAKE_CURRENT_LIST_DIR}/cfx2.c - ${CMAKE_CURRENT_LIST_DIR}/common.c - ${CMAKE_CURRENT_LIST_DIR}/config.c - ${CMAKE_CURRENT_LIST_DIR}/cpm.c - ${CMAKE_CURRENT_LIST_DIR}/ctc.c - ${CMAKE_CURRENT_LIST_DIR}/dart.c - ${CMAKE_CURRENT_LIST_DIR}/diag.c - ${CMAKE_CURRENT_LIST_DIR}/dirmap.c + ${CMAKE_CURRENT_LIST_DIR}/cfx2.c + ${CMAKE_CURRENT_LIST_DIR}/common.c + ${CMAKE_CURRENT_LIST_DIR}/config.c + ${CMAKE_CURRENT_LIST_DIR}/cpm.c + ${CMAKE_CURRENT_LIST_DIR}/ctc.c + ${CMAKE_CURRENT_LIST_DIR}/dart.c + ${CMAKE_CURRENT_LIST_DIR}/diag.c + ${CMAKE_CURRENT_LIST_DIR}/dirmap.c + ${CMAKE_CURRENT_LIST_DIR}/dis.c + ${CMAKE_CURRENT_LIST_DIR}/joy_sdl.c + ${CMAKE_CURRENT_LIST_DIR}/kbd2.c + ${CMAKE_CURRENT_LIST_DIR}/main.c + ${CMAKE_CURRENT_LIST_DIR}/mem.c + ${CMAKE_CURRENT_LIST_DIR}/memu.c + ${CMAKE_CURRENT_LIST_DIR}/mfx.c + ${CMAKE_CURRENT_LIST_DIR}/mon.c + ${CMAKE_CURRENT_LIST_DIR}/monprom.c + ${CMAKE_CURRENT_LIST_DIR}/nfx.c + ${CMAKE_CURRENT_LIST_DIR}/printer.c + ${CMAKE_CURRENT_LIST_DIR}/rom_os.c + ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c + ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c + ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c + ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c + ${CMAKE_CURRENT_LIST_DIR}/sdcard.c + ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c + ${CMAKE_CURRENT_LIST_DIR}/sid.c + ${CMAKE_CURRENT_LIST_DIR}/snd_sdl.c + ${CMAKE_CURRENT_LIST_DIR}/spec.c + ${CMAKE_CURRENT_LIST_DIR}/tape.c + ${CMAKE_CURRENT_LIST_DIR}/txtwin.c + ${CMAKE_CURRENT_LIST_DIR}/ui.c + ${CMAKE_CURRENT_LIST_DIR}/vdeb.c + ${CMAKE_CURRENT_LIST_DIR}/vdp.c + ${CMAKE_CURRENT_LIST_DIR}/vga.c + ${CMAKE_CURRENT_LIST_DIR}/vid.c + ${CMAKE_CURRENT_LIST_DIR}/win.c + ${CMAKE_CURRENT_LIST_DIR}/win_sdl.c + ) + + if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + list(APPEND sdl_src ${CMAKE_CURRENT_LIST_DIR}/dirt_unix.c - ${CMAKE_CURRENT_LIST_DIR}/dis.c - ${CMAKE_CURRENT_LIST_DIR}/joy_sdl.c - ${CMAKE_CURRENT_LIST_DIR}/kbd2.c - ${CMAKE_CURRENT_LIST_DIR}/main.c - ${CMAKE_CURRENT_LIST_DIR}/mem.c - ${CMAKE_CURRENT_LIST_DIR}/memu.c - ${CMAKE_CURRENT_LIST_DIR}/mfx.c - ${CMAKE_CURRENT_LIST_DIR}/mon.c - ${CMAKE_CURRENT_LIST_DIR}/monprom.c - ${CMAKE_CURRENT_LIST_DIR}/nfx.c - ${CMAKE_CURRENT_LIST_DIR}/printer.c - ${CMAKE_CURRENT_LIST_DIR}/rom_os.c - ${CMAKE_CURRENT_LIST_DIR}/rom_assem.c - ${CMAKE_CURRENT_LIST_DIR}/rom_basic.c - ${CMAKE_CURRENT_LIST_DIR}/rom_boot_type07.c - ${CMAKE_CURRENT_LIST_DIR}/rom_sdx_type07.c - ${CMAKE_CURRENT_LIST_DIR}/sdcard.c - ${CMAKE_CURRENT_LIST_DIR}/sdxfdc.c - ${CMAKE_CURRENT_LIST_DIR}/sid.c - ${CMAKE_CURRENT_LIST_DIR}/snd_sdl.c - ${CMAKE_CURRENT_LIST_DIR}/spec.c - ${CMAKE_CURRENT_LIST_DIR}/tape.c - ${CMAKE_CURRENT_LIST_DIR}/txtwin.c - ${CMAKE_CURRENT_LIST_DIR}/ui.c - ${CMAKE_CURRENT_LIST_DIR}/vdeb.c - ${CMAKE_CURRENT_LIST_DIR}/vdp.c - ${CMAKE_CURRENT_LIST_DIR}/vga.c - ${CMAKE_CURRENT_LIST_DIR}/vid.c - ${CMAKE_CURRENT_LIST_DIR}/win.c - ${CMAKE_CURRENT_LIST_DIR}/win_sdl.c ) + elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + list(APPEND sdl_src + ${CMAKE_CURRENT_LIST_DIR}/dirt_win.c + ) + else() + message(FATAL_ERROR "Directory Traversal Routines not supported") + endif() if( NOT (${CMAKE_VERSION} VERSION_LESS "3.12.0"))