summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Lioncash2019-04-15 17:32:47 -0400
committerGravatar Lioncash2019-04-16 21:23:34 -0400
commit819c21d99e39dd90cefd84a2c4d8884982456d44 (patch)
tree81850ba85c4465654727608948aa561b4a24dfd9
parentMerge pull request #2378 from lioncash/ro (diff)
downloadyuzu-819c21d99e39dd90cefd84a2c4d8884982456d44.tar.gz
yuzu-819c21d99e39dd90cefd84a2c4d8884982456d44.tar.xz
yuzu-819c21d99e39dd90cefd84a2c4d8884982456d44.zip
CMakeLists: Ensure we specify Unicode as the codepage on Windows
Previously we were building with MBCS, which is pretty undesirable. We want the application to be Unicode-aware in general. Currently, we make the command line variant of yuzu use ANSI variants of the non-standard getopt functions that we link in for Windows, given we only have an ANSI option-set. We should really replace getopt with a library that we make all build types of yuzu link in, but this will have to do for the time being.
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/yuzu_cmd/yuzu.cpp10
2 files changed, 9 insertions, 4 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6c99dd5e2..9aea4af87 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,9 @@ if (MSVC)
18 # Avoid windows.h from including some usually unused libs like winsocks.h, since this might cause some redefinition errors. 18 # Avoid windows.h from including some usually unused libs like winsocks.h, since this might cause some redefinition errors.
19 add_definitions(-DWIN32_LEAN_AND_MEAN) 19 add_definitions(-DWIN32_LEAN_AND_MEAN)
20 20
21 # Ensure that projects build with Unicode support.
22 add_definitions(-DUNICODE -D_UNICODE)
23
21 # /W3 - Level 3 warnings 24 # /W3 - Level 3 warnings
22 # /MP - Multi-threaded compilation 25 # /MP - Multi-threaded compilation
23 # /Zi - Output debugging information 26 # /Zi - Output debugging information
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 7ea4a1b18..a1d7879b1 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -32,11 +32,7 @@
32#include "yuzu_cmd/config.h" 32#include "yuzu_cmd/config.h"
33#include "yuzu_cmd/emu_window/emu_window_sdl2.h" 33#include "yuzu_cmd/emu_window/emu_window_sdl2.h"
34 34
35#include <getopt.h>
36#include "core/file_sys/registered_cache.h" 35#include "core/file_sys/registered_cache.h"
37#ifndef _MSC_VER
38#include <unistd.h>
39#endif
40 36
41#ifdef _WIN32 37#ifdef _WIN32
42// windows.h needs to be included before shellapi.h 38// windows.h needs to be included before shellapi.h
@@ -45,6 +41,12 @@
45#include <shellapi.h> 41#include <shellapi.h>
46#endif 42#endif
47 43
44#undef _UNICODE
45#include <getopt.h>
46#ifndef _MSC_VER
47#include <unistd.h>
48#endif
49
48#ifdef _WIN32 50#ifdef _WIN32
49extern "C" { 51extern "C" {
50// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable 52// tells Nvidia and AMD drivers to use the dedicated GPU by default on laptops with switchable