summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to '')
-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)
/Zo
/permissive-
/EHsc
- /std:c++latest
+ /std:c++20
/utf-8
/volatile:iso
/Zc:externConstexpr
@@ -51,8 +51,10 @@ if (MSVC)
/Zc:throwingNew
/GT
+ # Modules
+ /experimental:module- # Disable module support explicitly due to conflicts with precompiled headers
+
# External headers diagnostics
- /experimental:external # Enables the external headers options. This option isn't required in Visual Studio 2019 version 16.10 and later
/external:anglebrackets # Treats all headers included by #include <header>, where the header file is enclosed in angle brackets (< >), as external headers
/external:W0 # Sets the default warning level to 0 for external headers, effectively turning off warnings for external headers
@@ -83,7 +85,7 @@ if (MSVC)
)
if (USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS)
- # when caching, we need to use /Z7 to downgrade debug info to use an older but more cachable format
+ # when caching, we need to use /Z7 to downgrade debug info to use an older but more cacheable format
# Precompiled headers are deleted if not using /Z7. See https://github.com/nanoant/CMakePCHCompiler/issues/21
add_compile_options(/Z7)
else()
@@ -113,6 +115,9 @@ else()
$<$<CXX_COMPILER_ID:Clang>:-Wno-braced-scalar-init>
$<$<CXX_COMPILER_ID:Clang>:-Wno-unused-private-field>
+ $<$<CXX_COMPILER_ID:Clang>:-Werror=shadow-uncaptured-local>
+ $<$<CXX_COMPILER_ID:Clang>:-Werror=implicit-fallthrough>
+ $<$<CXX_COMPILER_ID:Clang>:-Werror=type-limits>
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-braced-scalar-init>
$<$<CXX_COMPILER_ID:AppleClang>:-Wno-unused-private-field>
)
@@ -126,6 +131,17 @@ else()
add_compile_options("-stdlib=libc++")
endif()
+ # GCC bugs
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "12" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ # These diagnostics would be great if they worked, but are just completely broken
+ # and produce bogus errors on external libraries like fmt.
+ add_compile_options(
+ -Wno-array-bounds
+ -Wno-stringop-overread
+ -Wno-stringop-overflow
+ )
+ endif()
+
# Set file offset size to 64 bits.
#
# On modern Unixes, this is typically already the case. The lone exception is
@@ -181,3 +197,8 @@ endif()
if (ENABLE_WEB_SERVICE)
add_subdirectory(web_service)
endif()
+
+if (ANDROID)
+ add_subdirectory(android/app/src/main/jni)
+ target_include_directories(yuzu-android PRIVATE android/app/src/main)
+endif()