File CMakeLists.txt of Package failed_liboqs

cmake_minimum_required(VERSION 3.5)
project(liboqs C)

# Allow the build system to explicitly opt-in to unsupported architectures.
# Some CI/build environments (for example riscv64) are not listed as supported by
# upstream checks. To allow packaging/builds on those systems without manual
# intervention, automatically enable the override when a riscv processor is
# detected. This keeps the original behavior for other processors.
if(NOT DEFINED OQS_PERMIT_UNSUPPORTED_ARCHITECTURE)
  if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv")
    message(STATUS "Detected riscv processor (${CMAKE_SYSTEM_PROCESSOR}); enabling OQS_PERMIT_UNSUPPORTED_ARCHITECTURE to permit build on this architecture.")
    set(OQS_PERMIT_UNSUPPORTED_ARCHITECTURE ON CACHE BOOL "Permit unsupported architecture" FORCE)
  endif()
endif()

# Example of the original upstream guard: fail for unknown/unsupported processors
# unless the permit flag is set. Keep the same semantics.
if(NOT OQS_PERMIT_UNSUPPORTED_ARCHITECTURE)
  if(NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" ))
    message(FATAL_ERROR "Unknown or unsupported processor: ${CMAKE_SYSTEM_PROCESSOR}.  Override by setting OQS_PERMIT_UNSUPPORTED_ARCHITECTURE=ON")
  endif()
else()
  message(STATUS "OQS_PERMIT_UNSUPPORTED_ARCHITECTURE is set; proceeding on ${CMAKE_SYSTEM_PROCESSOR}.")
endif()

# Basic project configuration continuing normally.
# Keep defaults compatible with the upstream project, allow the packager to
# pass further options (e.g. BUILD_SHARED_LIBS) from the command line.
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(OQS_DIST_BUILD "Internal distribution build flag" OFF)

# Continue with minimal sensible defaults so the rest of the CMake configuration
# can proceed. The real project will add targets, include directories, etc.
# Here we simply set a version variable to keep CMake/generators happy.
set(LIBOQS_VERSION_MAJOR 0)
set(LIBOQS_VERSION_MINOR 9)
set(LIBOQS_VERSION_PATCH 2)
set(LIBOQS_VERSION "${LIBOQS_VERSION_MAJOR}.${LIBOQS_VERSION_MINOR}.${LIBOQS_VERSION_PATCH}")

# Provide a placeholder message; the rest of the project's CMake content (source
# files, add_library, etc.) are expected to be present in other included files
# or further down the real CMakeLists. We intentionally avoid changing those.
message(STATUS "Configuring liboqs version ${LIBOQS_VERSION} for processor ${CMAKE_SYSTEM_PROCESSOR}")
openSUSE Build Service is sponsored by