Skip to content

Commit 2fe2dd1

Browse files
author
Steveice10
authored
Merge branch 'master' into vk-fixes
2 parents 0c9037f + 4f9fc88 commit 2fe2dd1

35 files changed

+446
-186
lines changed

.github/workflows/build.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
if: ${{ !github.head_ref }}
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
with:
1717
submodules: recursive
1818
- name: Pack
1919
run: ./.ci/source.sh
2020
- name: Upload
21-
uses: actions/upload-artifact@v3
21+
uses: actions/upload-artifact@v4
2222
with:
2323
name: source
2424
path: artifacts/
@@ -37,11 +37,11 @@ jobs:
3737
OS: linux
3838
TARGET: ${{ matrix.target }}
3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
with:
4242
submodules: recursive
4343
- name: Set up cache
44-
uses: actions/cache@v3
44+
uses: actions/cache@v4
4545
with:
4646
path: ${{ env.CCACHE_DIR }}
4747
key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}
@@ -53,7 +53,7 @@ jobs:
5353
run: ./.ci/pack.sh
5454
if: ${{ matrix.target == 'appimage' }}
5555
- name: Upload
56-
uses: actions/upload-artifact@v3
56+
uses: actions/upload-artifact@v4
5757
if: ${{ matrix.target == 'appimage' }}
5858
with:
5959
name: ${{ env.OS }}-${{ env.TARGET }}
@@ -70,11 +70,11 @@ jobs:
7070
OS: macos
7171
TARGET: ${{ matrix.target }}
7272
steps:
73-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
7474
with:
7575
submodules: recursive
7676
- name: Set up cache
77-
uses: actions/cache@v3
77+
uses: actions/cache@v4
7878
with:
7979
path: ${{ env.CCACHE_DIR }}
8080
key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}
@@ -87,7 +87,7 @@ jobs:
8787
- name: Prepare outputs for caching
8888
run: mv build/bundle $OS-$TARGET
8989
- name: Cache outputs for universal build
90-
uses: actions/cache/save@v3
90+
uses: actions/cache/save@v4
9191
with:
9292
path: ${{ env.OS }}-${{ env.TARGET }}
9393
key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
@@ -98,15 +98,15 @@ jobs:
9898
OS: macos
9999
TARGET: universal
100100
steps:
101-
- uses: actions/checkout@v3
101+
- uses: actions/checkout@v4
102102
- name: Download x86_64 build from cache
103-
uses: actions/cache/restore@v3
103+
uses: actions/cache/restore@v4
104104
with:
105105
path: ${{ env.OS }}-x86_64
106106
key: ${{ runner.os }}-x86_64-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
107107
fail-on-cache-miss: true
108108
- name: Download ARM64 build from cache
109-
uses: actions/cache/restore@v3
109+
uses: actions/cache/restore@v4
110110
with:
111111
path: ${{ env.OS }}-arm64
112112
key: ${{ runner.os }}-arm64-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt }}
@@ -118,7 +118,7 @@ jobs:
118118
- name: Pack
119119
run: ./.ci/pack.sh
120120
- name: Upload
121-
uses: actions/upload-artifact@v3
121+
uses: actions/upload-artifact@v4
122122
with:
123123
name: ${{ env.OS }}-${{ env.TARGET }}
124124
path: artifacts/
@@ -137,11 +137,11 @@ jobs:
137137
OS: windows
138138
TARGET: ${{ matrix.target }}
139139
steps:
140-
- uses: actions/checkout@v3
140+
- uses: actions/checkout@v4
141141
with:
142142
submodules: recursive
143143
- name: Set up cache
144-
uses: actions/cache@v3
144+
uses: actions/cache@v4
145145
with:
146146
path: ${{ env.CCACHE_DIR }}
147147
key: ${{ runner.os }}-${{ matrix.target }}-${{ github.sha }}
@@ -179,7 +179,7 @@ jobs:
179179
- name: Pack
180180
run: ./.ci/pack.sh
181181
- name: Upload
182-
uses: actions/upload-artifact@v3
182+
uses: actions/upload-artifact@v4
183183
with:
184184
name: ${{ env.OS }}-${{ env.TARGET }}
185185
path: artifacts/
@@ -192,11 +192,11 @@ jobs:
192192
OS: android
193193
TARGET: universal
194194
steps:
195-
- uses: actions/checkout@v3
195+
- uses: actions/checkout@v4
196196
with:
197197
submodules: recursive
198198
- name: Set up cache
199-
uses: actions/cache@v3
199+
uses: actions/cache@v4
200200
with:
201201
path: |
202202
~/.gradle/caches
@@ -228,7 +228,7 @@ jobs:
228228
env:
229229
UNPACKED: 1
230230
- name: Upload
231-
uses: actions/upload-artifact@v3
231+
uses: actions/upload-artifact@v4
232232
with:
233233
name: ${{ env.OS }}-${{ env.TARGET }}
234234
path: src/android/app/artifacts/
@@ -242,11 +242,11 @@ jobs:
242242
OS: ios
243243
TARGET: arm64
244244
steps:
245-
- uses: actions/checkout@v3
245+
- uses: actions/checkout@v4
246246
with:
247247
submodules: recursive
248248
- name: Set up cache
249-
uses: actions/cache@v3
249+
uses: actions/cache@v4
250250
with:
251251
path: ${{ env.CCACHE_DIR }}
252252
key: ${{ runner.os }}-ios-${{ github.sha }}
@@ -261,7 +261,7 @@ jobs:
261261
needs: [windows, linux, macos-universal, android, source]
262262
if: ${{ startsWith(github.ref, 'refs/tags/') }}
263263
steps:
264-
- uses: actions/download-artifact@v3
264+
- uses: actions/download-artifact@v4
265265
- name: Create release
266266
uses: actions/create-release@v1
267267
env:

.github/workflows/format.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
image: citraemu/build-environments:linux-fresh
1414
options: -u 1001
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
1919
- name: Build

.github/workflows/publish.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
if: ${{ github.event.inputs.nightly != 'false' && github.repository == 'citra-emu/citra' }}
2121
steps:
2222
# this checkout is required to make sure the GitHub Actions scripts are available
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424
name: Pre-checkout
2525
with:
2626
submodules: false
27-
- uses: actions/github-script@v6
27+
- uses: actions/github-script@v7
2828
id: check-changes
2929
name: 'Check for new changes'
3030
env:
@@ -38,15 +38,15 @@ jobs:
3838
return checkBaseChanges(github, context);
3939
- run: npm install execa@5
4040
if: ${{ steps.check-changes.outputs.result == 'true' }}
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
name: Checkout
4343
if: ${{ steps.check-changes.outputs.result == 'true' }}
4444
with:
4545
path: 'citra-merge'
4646
fetch-depth: 0
4747
submodules: true
4848
token: ${{ secrets.ALT_GITHUB_TOKEN }}
49-
- uses: actions/github-script@v6
49+
- uses: actions/github-script@v7
5050
name: 'Update and tag new commits'
5151
if: ${{ steps.check-changes.outputs.result == 'true' }}
5252
env:
@@ -62,11 +62,11 @@ jobs:
6262
if: ${{ github.event.inputs.canary != 'false' && github.repository == 'citra-emu/citra' }}
6363
steps:
6464
# this checkout is required to make sure the GitHub Actions scripts are available
65-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@v4
6666
name: Pre-checkout
6767
with:
6868
submodules: false
69-
- uses: actions/github-script@v6
69+
- uses: actions/github-script@v7
7070
id: check-changes
7171
name: 'Check for new changes'
7272
env:
@@ -79,15 +79,15 @@ jobs:
7979
return checkCanaryChanges(github, context);
8080
- run: npm install execa@5
8181
if: ${{ steps.check-changes.outputs.result == 'true' }}
82-
- uses: actions/checkout@v3
82+
- uses: actions/checkout@v4
8383
name: Checkout
8484
if: ${{ steps.check-changes.outputs.result == 'true' }}
8585
with:
8686
path: 'citra-merge'
8787
fetch-depth: 0
8888
submodules: true
8989
token: ${{ secrets.ALT_GITHUB_TOKEN }}
90-
- uses: actions/github-script@v6
90+
- uses: actions/github-script@v7
9191
name: 'Check and merge canary changes'
9292
if: ${{ steps.check-changes.outputs.result == 'true' }}
9393
env:

.github/workflows/transifex.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
container: citraemu/build-environments:linux-fresh
1111
if: ${{ github.repository == 'citra-emu/citra' }}
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
submodules: recursive
1616
fetch-depth: 0

externals/CMakeLists.txt

+13-4
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,20 @@ endif()
294294
add_library(httplib INTERFACE)
295295
if(USE_SYSTEM_CPP_HTTPLIB)
296296
find_package(CppHttp 0.14.1)
297-
if(CppHttp_FOUND)
298-
target_link_libraries(httplib INTERFACE httplib::httplib)
299-
else()
300-
message(STATUS "Cpp-httplib not found or not suitable version! Falling back to bundled...")
297+
# Detect if system cpphttplib is a shared library
298+
# this breaks building as Citra relies on functions that are moved
299+
# into the shared object.
300+
get_target_property(HTTP_LIBS httplib::httplib INTERFACE_LINK_LIBRARIES)
301+
if(HTTP_LIBS)
302+
message(WARNING "Shared cpp-http (${HTTP_LIBS}) not supported. Falling back to bundled...")
301303
target_include_directories(httplib SYSTEM INTERFACE ./httplib)
304+
else()
305+
if(CppHttp_FOUND)
306+
target_link_libraries(httplib INTERFACE httplib::httplib)
307+
else()
308+
message(STATUS "Cpp-httplib not found or not suitable version! Falling back to bundled...")
309+
target_include_directories(httplib SYSTEM INTERFACE ./httplib)
310+
endif()
302311
endif()
303312
else()
304313
target_include_directories(httplib SYSTEM INTERFACE ./httplib)

src/android/app/src/main/java/org/citra/citra_emu/CitraApplication.kt

+14
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ import android.app.Application
99
import android.app.NotificationChannel
1010
import android.app.NotificationManager
1111
import android.content.Context
12+
import android.os.Build
1213
import org.citra.citra_emu.utils.DirectoryInitialization
1314
import org.citra.citra_emu.utils.DocumentsTree
1415
import org.citra.citra_emu.utils.GpuDriverHelper
1516
import org.citra.citra_emu.utils.PermissionsHandler
17+
import org.citra.citra_emu.utils.Log
18+
import org.citra.citra_emu.utils.MemoryUtil
1619

1720
class CitraApplication : Application() {
1821
private fun createNotificationChannel() {
@@ -53,9 +56,20 @@ class CitraApplication : Application() {
5356
}
5457

5558
NativeLibrary.logDeviceInfo()
59+
logDeviceInfo()
5660
createNotificationChannel()
5761
}
5862

63+
fun logDeviceInfo() {
64+
Log.info("Device Manufacturer - ${Build.MANUFACTURER}")
65+
Log.info("Device Model - ${Build.MODEL}")
66+
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
67+
Log.info("SoC Manufacturer - ${Build.SOC_MANUFACTURER}")
68+
Log.info("SoC Model - ${Build.SOC_MODEL}")
69+
}
70+
Log.info("Total System Memory - ${MemoryUtil.getDeviceRAM()}")
71+
}
72+
5973
companion object {
6074
private var application: CitraApplication? = null
6175

src/android/app/src/main/java/org/citra/citra_emu/NativeLibrary.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ object NativeLibrary {
413413
}
414414

415415
fun setEmulationActivity(emulationActivity: EmulationActivity?) {
416-
Log.verbose("[NativeLibrary] Registering EmulationActivity.")
416+
Log.debug("[NativeLibrary] Registering EmulationActivity.")
417417
sEmulationActivity = WeakReference(emulationActivity)
418418
}
419419

420420
fun clearEmulationActivity() {
421-
Log.verbose("[NativeLibrary] Unregistering EmulationActivity.")
421+
Log.debug("[NativeLibrary] Unregistering EmulationActivity.")
422422
sEmulationActivity.clear()
423423
}
424424

src/android/app/src/main/java/org/citra/citra_emu/utils/DirectoryInitialization.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ object DirectoryInitialization {
9494
val dataPath = PermissionsHandler.citraDirectory
9595
if (dataPath.toString().isNotEmpty()) {
9696
userPath = dataPath.toString()
97-
Log.debug("[DirectoryInitialization] User Dir: $userPath")
97+
android.util.Log.d("[Citra Frontend]", "[DirectoryInitialization] User Dir: $userPath")
9898
return true
9999
}
100100
return false
101101
}
102102

103103
private fun copyAsset(asset: String, output: File, overwrite: Boolean, context: Context) {
104-
Log.verbose("[DirectoryInitialization] Copying File $asset to $output")
104+
Log.debug("[DirectoryInitialization] Copying File $asset to $output")
105105
try {
106106
if (!output.exists() || overwrite) {
107107
val inputStream = context.assets.open(asset)
@@ -121,7 +121,7 @@ object DirectoryInitialization {
121121
overwrite: Boolean,
122122
context: Context
123123
) {
124-
Log.verbose("[DirectoryInitialization] Copying Folder $assetFolder to $outputFolder")
124+
Log.debug("[DirectoryInitialization] Copying Folder $assetFolder to $outputFolder")
125125
try {
126126
var createdFolder = false
127127
for (file in context.assets.list(assetFolder)!!) {

src/android/app/src/main/java/org/citra/citra_emu/utils/Log.kt

+5-22
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,17 @@
44

55
package org.citra.citra_emu.utils
66

7-
import android.util.Log
8-
import org.citra.citra_emu.BuildConfig
9-
10-
/**
11-
* Contains methods that call through to [android.util.Log], but
12-
* with the same TAG automatically provided. Also no-ops VERBOSE and DEBUG log
13-
* levels in release builds.
14-
*/
157
object Log {
168
// Tracks whether we should share the old log or the current log
179
var gameLaunched = false
18-
private const val TAG = "Citra Frontend"
1910

20-
fun verbose(message: String?) {
21-
if (BuildConfig.DEBUG) {
22-
Log.v(TAG, message!!)
23-
}
24-
}
11+
external fun debug(message: String)
2512

26-
fun debug(message: String?) {
27-
if (BuildConfig.DEBUG) {
28-
Log.d(TAG, message!!)
29-
}
30-
}
13+
external fun warning(message: String)
3114

32-
fun info(message: String?) = Log.i(TAG, message!!)
15+
external fun info(message: String)
3316

34-
fun warning(message: String?) = Log.w(TAG, message!!)
17+
external fun error(message: String)
3518

36-
fun error(message: String?) = Log.e(TAG, message!!)
19+
external fun critical(message: String)
3720
}

0 commit comments

Comments
 (0)