From 6201256e15ee4d4fc053933545abf50fc46be178 Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sat, 28 Mar 2026 12:21:42 +0100 Subject: [PATCH] cmake: Add option to use system oaknut (#1947) Signed-off-by: Marcin Serwin --- externals/CMakeLists.txt | 8 +++++++- externals/cmake-modules/CitraHandleSystemLibs.cmake | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index db8de43a7..2ee7018a3 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -111,7 +111,13 @@ endif() # Oaknut if ("arm64" IN_LIST ARCHITECTURE) - add_subdirectory(oaknut EXCLUDE_FROM_ALL) + if(USE_SYSTEM_OAKNUT) + find_package(oaknut REQUIRED) + add_library(oaknut INTERFACE) + target_link_libraries(oaknut INTERFACE merry::oaknut) + else() + add_subdirectory(oaknut EXCLUDE_FROM_ALL) + endif() endif() # Dynarmic diff --git a/externals/cmake-modules/CitraHandleSystemLibs.cmake b/externals/cmake-modules/CitraHandleSystemLibs.cmake index 00fbd7cbe..16fa06fdb 100644 --- a/externals/cmake-modules/CitraHandleSystemLibs.cmake +++ b/externals/cmake-modules/CitraHandleSystemLibs.cmake @@ -14,6 +14,7 @@ option(USE_SYSTEM_JSON "Use the system JSON (nlohmann-json3) package (instead of option(USE_SYSTEM_DYNARMIC "Use the system dynarmic (instead of the bundled one)" OFF) option(USE_SYSTEM_FMT "Use the system fmt (instead of the bundled one)" OFF) option(USE_SYSTEM_XBYAK "Use the system xbyak (instead of the bundled one)" OFF) +option(USE_SYSTEM_OAKNUT "Use the system oaknut (instead of the bundled one)" OFF) option(USE_SYSTEM_INIH "Use the system inih (instead of the bundled one)" OFF) option(USE_SYSTEM_FFMPEG_HEADERS "Use the system FFmpeg headers (instead of the bundled one)" OFF) option(USE_SYSTEM_GLSLANG "Use the system glslang and SPIR-V libraries (instead of the bundled ones)" OFF) @@ -40,6 +41,7 @@ CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_JSON "Disable system JSON" OFF "USE_SYSTEM CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_DYNARMIC "Disable system Dynarmic" OFF "USE_SYSTEM_LIBS" OFF) CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_FMT "Disable system fmt" OFF "USE_SYSTEM_LIBS" OFF) CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_XBYAK "Disable system xbyak" OFF "USE_SYSTEM_LIBS" OFF) +CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_OAKNUT "Disable system oaknut" OFF "USE_SYSTEM_LIBS" OFF) CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_INIH "Disable system inih" OFF "USE_SYSTEM_LIBS" OFF) CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_FFMPEG_HEADERS "Disable system ffmpeg" OFF "USE_SYSTEM_LIBS" OFF) CMAKE_DEPENDENT_OPTION(DISABLE_SYSTEM_GLSLANG "Disable system glslang" OFF "USE_SYSTEM_LIBS" OFF) @@ -66,6 +68,7 @@ set(LIB_VAR_LIST DYNARMIC FMT XBYAK + OAKNUT INIH FFMPEG_HEADERS GLSLANG