From 3b5f0177ff2c3976863c520bb164d68fdde39ec0 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Sat, 13 Jul 2024 14:32:29 +0200 Subject: [PATCH] include/CMakeLists.txt: error out when architecture is not supported Since commit b98c56fd5e86fa76eb55a98a2266a923f64f705c ("stop exposing hidden defines in public opensslconf.h"), only a subset of CPU architectures is supported by libressl. However, when a build is attempted for an unsupported architecture, it doesn't fail with a clear error message at configure time, but it fails with a weird error at build time: crypto/../include/openssl/rc4.h:75:9: error: unknown type name 'RC4_INT' In order to help users, let's bail out nicely at configure time with a good error message when the CPU architecture is not supported. Signed-off-by: Thomas Petazzoni --- include/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 9d015cd5ea..59f5b62adc 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -38,5 +38,7 @@ elseif(HOST_SPARC64) file(READ arch/sparc64/opensslconf.h OPENSSLCONF) elseif(HOST_X86_64) file(READ arch/amd64/opensslconf.h OPENSSLCONF) +else() + message(FATAL_ERROR "Architecture not supported") endif() file(WRITE ${CMAKE_BINARY_DIR}/include/openssl/opensslconf.h "${OPENSSLCONF}")