|
1 | 1 | set( ILP64_FOUND TRUE CACHE BOOL "ILP64 Flags Found" FORCE ) |
2 | 2 | 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> |
5 | 3 | # Make default integers 64-bit for Fortran |
6 | 4 | $<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<C_COMPILER_ID:Intel,PGI>>:-i8> |
7 | 5 | $<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<C_COMPILER_ID:GNU,Flang,LLVMFlang>>:-fdefault-integer-8> |
8 | 6 | ) |
| 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 | + |
9 | 15 | set( ILP64_COMPILE_OPTIONS "${ILP64_COMPILE_OPTIONS}" CACHE STRING "ILP64 compile options" FORCE ) |
10 | 16 |
|
11 | 17 | foreach (lang C CXX Fortran) |
12 | 18 | if ( NOT DEFINED CMAKE_${lang}_COMPILER_ID ) |
13 | 19 | continue() |
14 | 20 | endif() |
15 | 21 | 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() |
17 | 25 | endif() |
18 | 26 | if ( lang STREQUAL Fortran ) |
19 | 27 | if ( CMAKE_Fortran_COMPILER_ID STREQUAL Intel OR CMAKE_Fortran_COMPILER_ID STREQUAL PGI ) |
|
0 commit comments