Skip to content

Commit 756b17d

Browse files
committed
fix for aarch64
1 parent 290e2e0 commit 756b17d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

FindILP64.cmake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
set( ILP64_FOUND TRUE CACHE BOOL "ILP64 Flags Found" FORCE )
22
set( ILP64_COMPILE_OPTIONS
3-
# Ensure 64-bit executables for GNU C,CXX,Fortran
4-
$<$<AND:$<COMPILE_LANGUAGE:CXX,C,Fortran>,$<C_COMPILER_ID:GNU>>:-m64>
53
# Make default integers 64-bit for Fortran
64
$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<C_COMPILER_ID:Intel,PGI>>:-i8>
75
$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<C_COMPILER_ID:GNU,Flang,LLVMFlang>>:-fdefault-integer-8>
86
)
7+
8+
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
9+
list( APPEND ILP64_COMPILE_OPTIONS
10+
# Ensure 64-bit executables for GNU C,CXX,Fortran
11+
$<$<AND:$<COMPILE_LANGUAGE:CXX,C,Fortran>,$<C_COMPILER_ID:GNU>>:-m64>
12+
)
13+
endif()
14+
915
set( ILP64_COMPILE_OPTIONS "${ILP64_COMPILE_OPTIONS}" CACHE STRING "ILP64 compile options" FORCE )
1016

1117
foreach (lang C CXX Fortran)
1218
if ( NOT DEFINED CMAKE_${lang}_COMPILER_ID )
1319
continue()
1420
endif()
1521
if ( CMAKE_${lang}_COMPILER_ID STREQUAL GNU )
16-
list( APPEND ILP64_${lang}_COMPILE_OPTIONS -m64 )
22+
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
23+
list( APPEND ILP64_${lang}_COMPILE_OPTIONS -m64 )
24+
endif()
1725
endif()
1826
if ( lang STREQUAL Fortran )
1927
if ( CMAKE_Fortran_COMPILER_ID STREQUAL Intel OR CMAKE_Fortran_COMPILER_ID STREQUAL PGI )

0 commit comments

Comments
 (0)