games-emulation/dosbox-staging: allow build on all arches

New cmake build system only allows builds for x86-64 and arm64, allow
this on all arches (with interpreter-only configuration, as in older
releases)

Thanks to Filip "widelec" Maryjanski for report and patch

Signed-off-by: Bernard Cafarelli <voyageur@gentoo.org>
This commit is contained in:
Bernard Cafarelli
2026-09-23 10:39:48 +02:00
parent 591fbf4fb7
commit d95d83e6e6
2 changed files with 50 additions and 0 deletions

View File

@@ -48,6 +48,7 @@ BDEPEND="test? ( dev-cpp/gtest )
PATCHES=(
"${FILESDIR}"/${P}-optional_mt32.patch
"${FILESDIR}"/${P}-any-cpu.patch
)
DOCS=( README.md docs/AUTHORS )

View File

@@ -0,0 +1,49 @@
From 37d5cd10f72d0342405940a605a907246ffb1fce Mon Sep 17 00:00:00 2001
From: widelec-BB <widelec@morphos.pl>
Date: Tue, 22 Sep 2026 16:27:51 +0200
Subject: [PATCH] build: Allow to build on machines with CPU other than x86 and
ARM
Don't hard-fail on unknown processors; build interpreter-only
x86 and arm64 remain the only optimized targets, but ppc64,
riscv64 and others can now build and run with the generic core
instead of dying at configure time.
---
CMakeLists.txt | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 679470e64..d57445810 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,6 +277,7 @@ check_cxx_source_compiles("${TEST_CODE_BUILTIN_CLEAR_CACHE}"
set(C_TARGET_CPU_ARM OFF)
set(C_TARGET_CPU_X86 OFF)
+set(C_TARGET_CPU_UNK OFF)
option(OPT_FORCE_DYNREC "Force DYNREC dynamic recompiler (not x86-64 optimized)" OFF)
@@ -307,9 +308,16 @@ elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" OR
set(C_DYNREC ON)
set(C_FPU_X86 OFF)
set(C_UNALIGNED_MEMORY OFF)
-
else()
- message(FATAL_ERROR "Unknown processor ${CMAKE_SYSTEM_PROCESSOR}")
+ message(WARNING "Unsupported processor ${CMAKE_SYSTEM_PROCESSOR}: "
+ "building interpreter-only, untested configuration")
+
+ set(C_TARGET_CPU_UNK ON)
+
+ set(C_DYNAMIC_X86 OFF)
+ set(C_DYNREC OFF)
+ set(C_FPU_X86 OFF)
+ set(C_UNALIGNED_MEMORY OFF)
endif()
check_include_file("libgen.h" HAVE_LIBGEN_H)
--
2.55.0