add cflags
This commit is contained in:
@@ -41,6 +41,7 @@ include_directories(
|
||||
../../external/SDL/include
|
||||
../../external/sse2neon
|
||||
../../external/capstone/include
|
||||
../../external/cflags/include
|
||||
)
|
||||
|
||||
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/unarr unarr)
|
||||
add_subdirectory(../../external/SDL SDL)
|
||||
add_subdirectory(../../external/cflags cflags)
|
||||
set(CAPSTONE_ARCHITECTURE_DEFAULT OFF)
|
||||
set(CAPSTONE_MIPS_SUPPORT ON)
|
||||
set(CAPSTONE_X86_SUPPORT ON)
|
||||
add_subdirectory(../../external/capstone capstone)
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
|
||||
add_executable(kaizen
|
||||
main.cpp
|
||||
KaizenQt.hpp
|
||||
@@ -126,7 +124,7 @@ add_executable(kaizen
|
||||
Debugger.cpp
|
||||
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)
|
||||
|
||||
file(COPY ../../resources/ DESTINATION ${PROJECT_BINARY_DIR}/resources/)
|
||||
|
||||
@@ -1,25 +1,17 @@
|
||||
#include <KaizenQt.hpp>
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <cflags.hpp>
|
||||
|
||||
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;
|
||||
if (parser.isSet("rom")) {
|
||||
kaizenQt.LoadROM(parser.value("rom"));
|
||||
if (parser.isSet("movie")) {
|
||||
kaizenQt.LoadTAS(parser.value("movie"));
|
||||
}
|
||||
cflags::cflags flags;
|
||||
std::string romPath;
|
||||
std::string moviePath;
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user