Browse Source
[ci] improve ccache and add support on Android (#2673 )
* disable PCH
* fix missing headers after disabling PCH
* add support to extra cmake flags on Android building
* remove debug symbols on Release building (also fixing ccache on windows)
Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2673
Reviewed-by: crueter <crueter@eden-emu.dev>
Co-authored-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Co-committed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
pull/2668/head
Caio Oliveira
3 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
10 changed files with
41 additions and
22 deletions
CMakeLists.txt
docs/build/Android.md
externals/CMakeLists.txt
src/CMakeLists.txt
src/android/app/build.gradle.kts
src/dynarmic/CMakeLists.txt
src/dynarmic/src/dynarmic/backend/arm64/abi.h
src/dynarmic/src/dynarmic/common/assert.h
src/dynarmic/src/dynarmic/common/memory_pool.h
src/dynarmic/src/dynarmic/ir/opt_passes.cpp
@ -287,6 +287,13 @@ if (ANDROID)
set ( CMAKE_POLICY_VERSION_MINIMUM 3.5 ) # W o r k a r o u n d f o r O b o e
endif ( )
# W e n e e d t o d o w n g r a d e d e b u g info ( /Zi -> /Z7 ) t o u s e a n o l d e r b u t m o r e c a c h e a b l e f o r m a t
# S e e h t t p s : / / g i t h u b . c o m / n a n o a n t / C M a k e P C H C o m p i l e r / i s s u e s / 2 1
if ( WIN32 AND ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" ) )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
endif ( )
# D e f a u l t t o a R e l e a s e b u i l d
get_property ( IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
if ( NOT IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE )
@ -33,6 +33,7 @@ Eden by default will be cloned into -
4. Navigate to `eden/src/android` .
5. Then Build with `./gradlew assembleRelWithDebInfo` .
6. To build the optimised build use `./gradlew assembleGenshinSpoofRelWithDebInfo` .
7. You can pass extra variables to cmake via `-PYUZU_ANDROID_ARGS="-D..."`
### Script
A convenience script for building is provided in `.ci/android/build.sh` . The built APK can be put into an `artifacts` directory via `.ci/android/package.sh` . On Windows, these must be done in the Git Bash or MinGW terminal.
@ -155,12 +155,14 @@ if (YUZU_USE_BUNDLED_SIRIT)
AddJsonPackage ( sirit-ci )
else ( )
AddJsonPackage ( sirit )
if ( MSVC AND USE_CCACHE AND sirit_ADDED )
get_target_property ( _opts sirit COMPILE_OPTIONS )
list ( FILTER _opts EXCLUDE REGEX "/Zi" )
list ( APPEND _opts "/Z7" )
set_target_properties ( siritobj PROPERTIES COMPILE_OPTIONS "${_opts}" )
elseif ( MSVC AND CXX_CLANG )
# C h a n g e t o o l d - b u t - m o r e - c a c h e a b l e d e b u g i n f o o n W i n d o w s
if ( WIN32 AND ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" ) )
get_target_property ( sirit_opts sirit COMPILE_OPTIONS )
list ( FILTER sirit_opts EXCLUDE REGEX "/Zi" )
list ( APPEND sirit_opts "/Z7" )
set_target_properties ( sirit PROPERTIES COMPILE_OPTIONS "${sirit_opts}" )
endif ( )
if ( MSVC AND CXX_CLANG )
target_compile_options ( siritobj PRIVATE -Wno-error=unused-command-line-argument )
endif ( )
endif ( )
@ -101,15 +101,9 @@ if (MSVC AND NOT CXX_CLANG)
)
endif ( )
if ( USE_CCACHE OR YUZU_USE_PRECOMPILED_HEADERS )
# w h e n c a c h i n g , w e n e e d t o u s e / Z 7 t o d o w n g r a d e d e b u g i n f o t o u s e a n o l d e r b u t m o r e c a c h e a b l e f o r m a t
# P r e c o m p i l e d h e a d e r s a r e d e l e t e d i f n o t u s i n g / Z 7 . S e e h t t p s : / / g i t h u b . c o m / n a n o a n t / C M a k e P C H C o m p i l e r / i s s u e s / 2 1
add_compile_options ( /Z7 )
# A v o i d D 9 0 2 5 w a r n i n g
string ( REPLACE "/Zi" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
string ( REPLACE "/Zi" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
else ( )
add_compile_options ( /Zi )
if ( WIN32 AND ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" ) )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
endif ( )
if ( ARCHITECTURE_x86_64 )
@ -75,6 +75,8 @@ android {
externalNativeBuild {
cmake {
val extraCMakeArgs = (project.findProperty("YUZU_ANDROID_ARGS") as String?)?.split("\\s+".toRegex()) ?: emptyList()
arguments.addAll(listOf(
"-DENABLE_QT=0", // Don't use QT
"-DENABLE_SDL2=0", // Don't use SDL
@ -87,7 +89,8 @@ android {
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
"-DBUILD_TESTING=OFF",
"-DYUZU_TESTS=OFF",
"-DDYNARMIC_TESTS=OFF"
"-DDYNARMIC_TESTS=OFF",
*extraCMakeArgs.toTypedArray()
))
abiFilters("arm64-v8a")
@ -25,11 +25,7 @@ option(DYNARMIC_IGNORE_ASSERTS "Ignore asserts" OFF)
option ( DYNARMIC_TESTS_USE_UNICORN "Enable fuzzing tests against unicorn" OFF )
CMAKE_DEPENDENT_OPTION ( DYNARMIC_USE_LLVM "Support disassembly of jitted x86_64 code using LLVM" OFF "NOT YUZU_DISABLE_LLVM" OFF )
if ( PLATFORM_OPENBSD )
option ( DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF )
else ( )
option ( DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON )
endif ( )
option ( DYNARMIC_USE_PRECOMPILED_HEADERS "Use precompiled headers" OFF )
option ( DYNARMIC_INSTALL "Install dynarmic headers and CMake files" OFF )
option ( DYNARMIC_USE_BUNDLED_EXTERNALS "Use all bundled externals (useful when e.g. cross-compiling)" OFF )
@ -81,7 +77,6 @@ if (MSVC)
/ w d 4 5 9 2 # S y m b o l w i l l b e d y n a m i c a l l y initialized ( implementation limitation )
/ p e r m i s s i v e - # S t r i c t e r C + + s t a n d a r d s c o n f o r m a n c e
/ M P
/ Z i
/ Z o
/ E H s c
/ Z c : e x t e r n C o n s t e x p r # A l l o w s e x t e r n a l l i n k a g e f o r v a r i a b l e s d e c l a r e d " e x t e r n c o n s t e x p r " , a s t h e s t a n d a r d p e r m i t s .
@ -91,6 +86,11 @@ if (MSVC)
/ b i g o b j # I n c r e a s e n u m b e r o f s e c t i o n s i n . o b j f i l e s
/ D N O M I N M A X )
if ( WIN32 AND ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" ) )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
string ( REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" )
endif ( )
if ( DYNARMIC_WARNINGS_AS_ERRORS )
list ( APPEND DYNARMIC_CXX_FLAGS
/ W X )
@ -14,6 +14,7 @@
# include <mcl/mp/metavalue/lift_value.hpp>
# include "dynarmic/common/common_types.h"
# include "dynarmic/common/assert.h"
# include <oaknut/oaknut.hpp>
# include "dynarmic/common/always_false.h"
@ -23,6 +23,12 @@ template<typename... Ts>
} \
} ( ) )
# endif
# ifndef ASSERT_FALSE
# define ASSERT_FALSE(...) \
( [ & ] ( ) { \
assert_terminate ( " false " , __VA_ARGS__ ) ; \
} ( ) )
# endif
# ifndef ASSERT
# define ASSERT(_a_) ASSERT_MSG(_a_, "")
@ -1,3 +1,6 @@
/ / SPDX - FileCopyrightText : Copyright 2025 Eden Emulator Project
/ / SPDX - License - Identifier : GPL - 3.0 - or - later
/* This file is part of the dynarmic project.
* Copyright ( c ) 2016 MerryMage
* SPDX - License - Identifier : 0 BSD
@ -6,6 +9,7 @@
# pragma once
# include <cstddef>
# include <cstdlib>
# include <vector>
namespace Dynarmic : : Common {
@ -6,6 +6,7 @@
* SPDX - License - Identifier : 0 BSD
*/
# include <algorithm>
# include <cstdio>
# include <map>