mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-09-19 18:01:25 +03:00
cmake: fix Darwin cpu_features check testing the wrong variable
The Darwin branch of the cpu_features selection reads:
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME MATCHES "^(arm64|x86_64)")
The second condition tests CMAKE_SYSTEM_NAME, which is "Darwin" inside this
branch and so never matches ^(arm64|x86_64), where it plainly means
CMAKE_SYSTEM_PROCESSOR. The NOT is therefore always true, and the branch the
comment says we "should not reach" is the one always taken. The FreeBSD
branch three lines above gets this right.
The effect is currently masked -- macOS has no sys/auxv.h, so the
HAVE_SYS_AUXV branch already defines SKIP_CPU_FEATURES first -- but the
condition is still wrong and should behave as written if that check ever
changes.
This commit is contained in:
@@ -140,7 +140,7 @@ if(UNIX)
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd64|i386)")
|
||||
message("cpu_features is not available on FreeBSD/${CMAKE_SYSTEM_PROCESSOR}")
|
||||
add_definitions(-DSKIP_CPU_FEATURES)
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_NAME MATCHES "^(arm64|x86_64)")
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|x86_64)")
|
||||
# macOS runs only on Intel or ARM architecrues, should not reach here
|
||||
add_definitions(-DSKIP_CPU_FEATURES)
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS" OR ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
|
||||
Reference in New Issue
Block a user