summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c7283e82c..0696201df 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -43,7 +43,7 @@ if (MSVC)
43 /Zo 43 /Zo
44 /permissive- 44 /permissive-
45 /EHsc 45 /EHsc
46 /std:c++latest 46 /std:c++20
47 /utf-8 47 /utf-8
48 /volatile:iso 48 /volatile:iso
49 /Zc:externConstexpr 49 /Zc:externConstexpr
@@ -51,8 +51,10 @@ if (MSVC)
51 /Zc:throwingNew 51 /Zc:throwingNew
52 /GT 52 /GT
53 53
54 # Modules
55 /experimental:module- # Disable module support explicitly due to conflicts with precompiled headers
56
54 # External headers diagnostics 57 # External headers diagnostics
55 /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later
56 /external:anglebrackets # Treats all headers included by #include <header>, where the header file is enclosed in angle brackets (< >), as external headers 58 /external:anglebrackets # Treats all headers included by #include <header>, where the header file is enclosed in angle brackets (< >), as external headers
57 /external:W0 # Sets the default warning level to 0 for external headers, effectively turning off warnings for external headers 59 /external:W0 # Sets the default warning level to 0 for external headers, effectively turning off warnings for external headers
58 60
@@ -83,7 +85,7 @@ if (MSVC)
83 ) 85 )
84 86
85 if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS) 87 if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
86 # when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format 88 # when caching, we need to use /Z7 to downgrade debug info to use an older but more cacheable format
87 # Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21 89 # Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
88 add_compile_options(/Z7) 90 add_compile_options(/Z7)
89 else() 91 else()
@@ -113,6 +115,9 @@ else()
113 115
114 $<$<CXX_COMPILER_ID:Clang>:-Wno-braced-scalar-init> 116 $<$<CXX_COMPILER_ID:Clang>:-Wno-braced-scalar-init>
115 $<$<CXX_COMPILER_ID:Clang>:-Wno-unused-private-field> 117 $<$<CXX_COMPILER_ID:Clang>:-Wno-unused-private-field>
118 $<$<CXX_COMPILER_ID:Clang>:-Werror=shadow-uncaptured-local>
119 $<$<CXX_COMPILER_ID:Clang>:-Werror=implicit-fallthrough>
120 $<$<CXX_COMPILER_ID:Clang>:-Werror=type-limits>
116 $<$<CXX_COMPILER_ID:AppleClang>:-Wno-braced-scalar-init> 121 $<$<CXX_COMPILER_ID:AppleClang>:-Wno-braced-scalar-init>
117 $<$<CXX_COMPILER_ID:AppleClang>:-Wno-unused-private-field> 122 $<$<CXX_COMPILER_ID:AppleClang>:-Wno-unused-private-field>
118 ) 123 )
@@ -126,6 +131,17 @@ else()
126 add_compile_options("-stdlib=libc++") 131 add_compile_options("-stdlib=libc++")
127 endif() 132 endif()
128 133
134 # GCC bugs
135 if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
136 # These diagnostics would be great if they worked, but are just completely broken
137 # and produce bogus errors on external libraries like fmt.
138 add_compile_options(
139 -Wno-array-bounds
140 -Wno-stringop-overread
141 -Wno-stringop-overflow
142 )
143 endif()
144
129 # Set file offset size to 64 bits. 145 # Set file offset size to 64 bits.
130 # 146 #
131 # On modern Unixes, this is typically already the case. The lone exception is 147 # On modern Unixes, this is typically already the case. The lone exception is
@@ -181,3 +197,8 @@ endif()
181if (ENABLE_WEB_SERVICE) 197if (ENABLE_WEB_SERVICE)
182 add_subdirectory(web_service) 198 add_subdirectory(web_service)
183endif() 199endif()
200
201if (ANDROID)
202 add_subdirectory(android/app/src/main/jni)
203 target_include_directories(yuzu-android PRIVATE android/app/src/main)
204endif()