Skip to content

Commit

Permalink
CMake: simplified the detection of the default target architecture.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny authored Dec 9, 2024
2 parents 5825c5d + 73d9949 commit 413dda7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmake/environmentchecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ if(WIN32)
if(NOT INDEX EQUAL -1)
set(DEFAULT_TARGET_ARCHITECTURE Intel)
else()
string(FIND "${CMAKE_CXX_COMPILER}" "/arm64/" INDEX)

if(NOT INDEX EQUAL -1)
set(DEFAULT_TARGET_ARCHITECTURE ARM)
endif()
set(DEFAULT_TARGET_ARCHITECTURE ARM)
endif()
elseif(APPLE)
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
set(DEFAULT_TARGET_ARCHITECTURE Intel)
elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "arm64")
else()
set(DEFAULT_TARGET_ARCHITECTURE ARM)
endif()
else()
Expand All @@ -91,7 +87,7 @@ else()
else()
set(DEFAULT_TARGET_ARCHITECTURE Intel)
endif()
elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
else()
set(DEFAULT_TARGET_ARCHITECTURE ARM)
endif()
endif()
Expand Down

0 comments on commit 413dda7

Please sign in to comment.