summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGreg Wicks <gpwicks@email.wm.edu>2015-06-23 02:59:00 +0200
committerGreg Wicks <gpwicks@email.wm.edu>2015-07-12 21:49:23 +0200
commit9930ef72ddaf8930a9bf3e574b7de69f73ecbf87 (patch)
tree30af5b4937f81d1ea7bb9148ec27e71d5501d345 /src
parentMerge pull request #823 from Subv/applets_drawing (diff)
downloadyuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar.gz
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar.bz2
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar.lz
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar.xz
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.tar.zst
yuzu-9930ef72ddaf8930a9bf3e574b7de69f73ecbf87.zip
Diffstat (limited to 'src')
-rw-r--r--src/citra/CMakeLists.txt5
-rw-r--r--src/citra/citra.cpp40
2 files changed, 42 insertions, 3 deletions
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index 5e8cbfa35..918687312 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -16,8 +16,11 @@ create_directory_groups(${SRCS} ${HEADERS})
add_executable(citra ${SRCS} ${HEADERS})
target_link_libraries(citra core common video_core)
target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih)
+if (MSVC)
+ target_link_libraries(citra getopt)
+endif()
target_link_libraries(citra ${PLATFORM_LIBRARIES})
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD")
install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
-endif()
+endif() \ No newline at end of file
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index a59726c78..182646f4c 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -3,6 +3,15 @@
// Refer to the license.txt file included.
#include <string>
+#include <thread>
+#include <iostream>
+
+#ifdef _MSC_VER
+#include <getopt.h>
+#else
+#include <unistd.h>
+#include <getopt.h>
+#endif
#include "common/logging/log.h"
#include "common/logging/backend.h"
@@ -18,12 +27,39 @@
#include "video_core/video_core.h"
+
+static void PrintHelp()
+{
+ std::cout << "Usage: citra <filename>" << std::endl;
+}
+
/// Application entry point
int main(int argc, char **argv) {
+ int option_index = 0;
+ std::string boot_filename;
+ static struct option long_options[] = {
+ { "help", no_argument, 0, 'h' },
+ { 0, 0, 0, 0 }
+ };
+
+ while (optind < argc) {
+ char arg = getopt_long(argc, argv, ":h", long_options, &option_index);
+ if (arg != -1) {
+ switch (arg) {
+ case 'h':
+ PrintHelp();
+ return 0;
+ }
+ } else {
+ boot_filename = argv[optind];
+ optind++;
+ }
+ }
+
Log::Filter log_filter(Log::Level::Debug);
Log::SetFilter(&log_filter);
- if (argc < 2) {
+ if (boot_filename.empty()) {
LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
return -1;
}
@@ -31,7 +67,7 @@ int main(int argc, char **argv) {
Config config;
log_filter.ParseFilterString(Settings::values.log_filter);
- std::string boot_filename = argv[1];
+
EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
VideoCore::g_hw_renderer_enabled = Settings::values.use_hw_renderer;