From 0a1a1088e1cb7cf2c55ff657c97045bf9cce7d69 Mon Sep 17 00:00:00 2001 From: aMannus Date: Fri, 23 May 2025 10:44:40 +0200 Subject: [PATCH] Fix cmake for non-linux --- soh/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt index 9e2e9ece6..f9025450a 100644 --- a/soh/CMakeLists.txt +++ b/soh/CMakeLists.txt @@ -303,14 +303,17 @@ if (BUILD_REMOTE_CONTROL) set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS}) endif() - file(STRINGS /etc/os-release distro REGEX "^NAME=") - string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" distro "${distro}") + set(OPENSSL_USE_STATIC_LIBS ON) - if(${distro} MATCHES "Fedora Linux") - set(OPENSSL_USE_STATIC_LIBS OFF) - else() - set(OPENSSL_USE_STATIC_LIBS ON) + if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(STRINGS /etc/os-release distro REGEX "^NAME=") + string(REGEX REPLACE "NAME=\"(.*)\"" "\\1" distro "${distro}") + + if(${distro} MATCHES "Fedora Linux") + set(OPENSSL_USE_STATIC_LIBS OFF) + endif() endif() + find_package(OpenSSL) if(NOT OPENSSL_FOUND) message(STATUS "OpenSSL not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.")