diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/CMakeLists.txt | 5 | ||||
-rw-r--r-- | gui/main.cc | 42 |
2 files changed, 14 insertions, 33 deletions
diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 6b5eb22..0d73527 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 3.5) -set(CMAKE_CXX_COMPILER "g++") add_compile_options(-Wall -lstdc++) add_compile_options(-Wextra -Wpedantic) @@ -22,9 +21,9 @@ file(GLOB SRCS qt_add_resources(GUI_RESOURCES "resources.qrc") add_executable(risc_vector ${SRCS} ${GUI_RESOURCES}) -target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_lib Qt6::Widgets) +target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/inc) +target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_lib ram_lib Qt6::Widgets) set_target_properties(risc_vector PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" ) - diff --git a/gui/main.cc b/gui/main.cc index ce47d10..5e45465 100644 --- a/gui/main.cc +++ b/gui/main.cc @@ -1,5 +1,4 @@ -#include "cli.h" -#include "definitions.h" +#include "pipe_spec.h" #include "gui.h" #include "logger.h" #include <QApplication> @@ -34,31 +33,24 @@ static void print_version_number() static void err() { std::cerr << "Usage:\n\trisc_vector [OPTIONS]\nOptions:\n\t--debug,\t-d: " - "turn on verbose output\n\t--memory-only,\t-m: run the memory " - "simulator only, without a GUI.\n\t--version,\t-v: print the " - "version information and exit\n" + "turn on verbose output\n\t--version,\t-v: print the version " + "information and exit\n" << std::endl; } -static void parseArguments(int argc, char **argv, bool &memory_only) +static void parseArguments(int argc, char **argv) { struct option long_options[] = { - {"debug", no_argument, 0, 'd'}, - {"memory-only", no_argument, 0, 'm'}, - {0, 0, 0, 0}}; + {"debug", no_argument, 0, 'd'}, {0, 0, 0, 0}}; int opt; - while ((opt = getopt_long(argc, argv, "d:m", long_options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "d", long_options, NULL)) != -1) { switch (opt) { case 'd': global_log->setLevel(DEBUG); global_log->log(DEBUG, "DEBUG output enabled."); break; - case 'm': - global_log->log(INFO, "Starting the storage CLI interface..."); - memory_only = true; - break; default: err(); exit(EXIT_FAILURE); @@ -71,21 +63,11 @@ int main(int argc, char **argv) print_version_number(); global_log->log(INFO, "Initializing..."); - bool memory_only = false; - parseArguments(argc, argv, memory_only); - - if (memory_only) { - Cli cli; - cli.run(); - } else { - global_log->log(INFO, "Starting QT..."); - QApplication a(argc, argv); - GUI w; - w.show(); - return a.exec(); - } + parseArguments(argc, argv); - global_log->log(INFO, "Cleaning up..."); - global_log->log(INFO, "Goodbye!"); - return EXIT_SUCCESS; + global_log->log(INFO, "Starting QT..."); + QApplication a(argc, argv); + GUI w; + w.show(); + return a.exec(); } |