From 61e28760af091092dd70267092b1be5115b7115a Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Thu, 21 Dec 2023 22:50:24 +0500 Subject: [PATCH] cmake: fix wrong condition again. --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb335861..4b226167 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ option(USE_VOICEMGR "Enable VOICE MANAGER." OFF) option(BUILD_CLIENT "Build client dll" ON) option(BUILD_SERVER "Build server dll" ON) -if (CMAKE_SIZEOF_VOID_P EQUAL 4 OR +if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "x64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" @@ -57,7 +57,14 @@ else() option(64BIT "Disable auto -m32 appending to compiler flags" ON) endif() -if ((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR APPLE) AND NOT 64BIT) +# It seems CMAKE_SYSTEM_PROCESSOR parameter completely useless for APPLE platform, +# so may need to set options here manually. +if((WIN32 OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + AND (((CMAKE_SYSTEM_PROCESSOR STREQUAL "x64" + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64") AND NOT 64BIT) + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86" + OR CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")) option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" ON) else() option(GOLDSOURCE_SUPPORT "Build goldsource compatible client library" OFF)