Skip to content

Commit

Permalink
Use "FUNCHOOK_CPU MATCHES <string>"
Browse files Browse the repository at this point in the history
FUNCHOOK_CPU STREQUAL AMD64 will fail to resolve correctly if there is a variable named AMD64.
  • Loading branch information
rumblehhh authored Oct 12, 2021
1 parent 7bc6f18 commit e21981e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ include("GNUInstallDirs")

if(NOT FUNCHOOK_CPU)
set(FUNCHOOK_CPU ${CMAKE_SYSTEM_PROCESSOR})
if (FUNCHOOK_CPU STREQUAL x86_64 OR FUNCHOOK_CPU MATCHES "i.86" OR FUNCHOOK_CPU STREQUAL AMD64)
if (FUNCHOOK_CPU MATCHES "x86_64" OR FUNCHOOK_CPU MATCHES "i.86" OR FUNCHOOK_CPU MATCHES "AMD64")
set(FUNCHOOK_CPU x86)
endif ()
if (FUNCHOOK_CPU STREQUAL aarch64)
if (FUNCHOOK_CPU MATCHES "aarch64")
set(FUNCHOOK_CPU arm64)
endif ()
endif ()

if (FUNCHOOK_CPU STREQUAL arm64)
if (FUNCHOOK_CPU MATCHES "arm64")
set(FUNCHOOK_DEFAULT_DISASM "capstone")
else ()
set(FUNCHOOK_DEFAULT_DISASM "distorm")
Expand Down

0 comments on commit e21981e

Please sign in to comment.