Patch: Add s390x to c4_get_target_cpu_architecture

This commit is contained in:
Benjamin A. Beasley 2022-08-04 09:59:40 -04:00
parent 4fa9c33982
commit 3b60403e84
2 changed files with 38 additions and 0 deletions

34
10.patch Normal file
View File

@ -0,0 +1,34 @@
From 66325144daed7bb608b3a0b5a8de0525d4f601da Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Thu, 4 Aug 2022 09:57:20 -0400
Subject: [PATCH] Add s390x to c4_get_target_cpu_architecture
Also add it to c4_get_target_cpu_architecture_defines.
Reference: https://sourceforge.net/p/predef/wiki/Architectures/
---
TargetArchitecture.cmake | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/TargetArchitecture.cmake b/TargetArchitecture.cmake
index 2bf54d8..57baf66 100644
--- a/TargetArchitecture.cmake
+++ b/TargetArchitecture.cmake
@@ -28,6 +28,8 @@ function(c4_get_architecture_defines output_var)
set(defines __riscv64__)
elseif("${arch}" STREQUAL "riscv32")
set(defines __riscv32__)
+ elseif("${arch}" STREQUAL "s390x")
+ set(defines __s390x__)
else()
message(FATAL_ERROR "unknown target architecture: ${arch}")
endif()
@@ -90,6 +92,8 @@ function(c4_get_target_cpu_architecture output_var)
#else
#error cmake_ARCH riscv32
#endif
+#elif defined(__s390x__) || defined(__zarch__)
+ #error cmake_ARCH s390x
#endif
#error cmake_ARCH unknown
")

View File

@ -16,6 +16,10 @@ Source0: %{url}/archive/%{commit}/cmake-%{commit}.tar.gz
BuildArch: noarch
# Add s390x to c4_get_target_cpu_architecture
# https://github.com/biojppm/cmake/pull/10
Patch: %{url}/pull/10.patch
Requires: cmake-filesystem
Requires: git-core