add cflags

This commit is contained in:
SimoZ64
2025-04-15 14:09:43 +02:00
parent 3fff8ca568
commit 3ab403b8bd
2 changed files with 13 additions and 23 deletions

View File

@@ -41,6 +41,7 @@ include_directories(
../../external/SDL/include ../../external/SDL/include
../../external/sse2neon ../../external/sse2neon
../../external/capstone/include ../../external/capstone/include
../../external/cflags/include
) )
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF) option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." OFF)
@@ -94,15 +95,12 @@ add_subdirectory(../backend backend)
add_subdirectory(../../external/parallel-rdp parallel-rdp) add_subdirectory(../../external/parallel-rdp parallel-rdp)
add_subdirectory(../../external/unarr unarr) add_subdirectory(../../external/unarr unarr)
add_subdirectory(../../external/SDL SDL) add_subdirectory(../../external/SDL SDL)
add_subdirectory(../../external/cflags cflags)
set(CAPSTONE_ARCHITECTURE_DEFAULT OFF) set(CAPSTONE_ARCHITECTURE_DEFAULT OFF)
set(CAPSTONE_MIPS_SUPPORT ON) set(CAPSTONE_MIPS_SUPPORT ON)
set(CAPSTONE_X86_SUPPORT ON) set(CAPSTONE_X86_SUPPORT ON)
add_subdirectory(../../external/capstone capstone) add_subdirectory(../../external/capstone capstone)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
add_executable(kaizen add_executable(kaizen
main.cpp main.cpp
KaizenQt.hpp KaizenQt.hpp
@@ -126,7 +124,7 @@ add_executable(kaizen
Debugger.cpp Debugger.cpp
CodeModel.hpp) CodeModel.hpp)
target_link_libraries(kaizen PUBLIC SDL3::SDL3 SDL3::SDL3-static discord-rpc fmt mio nlohmann_json parallel-rdp capstone backend) target_link_libraries(kaizen PUBLIC SDL3::SDL3 SDL3::SDL3-static cflags::cflags discord-rpc fmt mio nlohmann_json parallel-rdp capstone backend)
target_compile_definitions(kaizen PUBLIC SDL_MAIN_HANDLED) target_compile_definitions(kaizen PUBLIC SDL_MAIN_HANDLED)
file(COPY ../../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/) file(COPY ../../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/)

View File

@@ -1,25 +1,17 @@
#include <KaizenQt.hpp> #include <KaizenQt.hpp>
#include <QApplication> #include <cflags.hpp>
#include <QCommandLineParser>
int main(int argc, char **argv) { int main(int argc, char **argv) {
const QApplication app(argc, argv);
QApplication::setStyle("fusion");
QCoreApplication::setOrganizationName("kaizen");
QCoreApplication::setApplicationName("Kaizen");
QCommandLineParser parser;
parser.setApplicationDescription(QCoreApplication::applicationName());
parser.addHelpOption();
parser.addOptions({{"rom", "Rom to launch from command-line", "path"}, {"movie", "Mupen Movie to replay", "path"}});
parser.process(app);
const KaizenQt kaizenQt; const KaizenQt kaizenQt;
if (parser.isSet("rom")) { cflags::cflags flags;
kaizenQt.LoadROM(parser.value("rom")); std::string romPath;
if (parser.isSet("movie")) { std::string moviePath;
kaizenQt.LoadTAS(parser.value("movie")); flags.add_string_callback('\0', "rom", [&kaizenQt](std::string v) { kaizenQt.LoadROM(v); }, "Rom to launch from command-line");
} flags.add_string_callback('\0', "movie", [&kaizenQt](std::string v) { kaizenQt.LoadTAS(v); }, "Mupen Movie to replay");
if(!flags.parse(argc, argv)) {
return -1;
} }
return QApplication::exec(); return 0;
} }