@@ -6,39 +6,45 @@ function(set_if_arch_bitness var_name)
6
6
"" # multi-value args
7
7
${ARGN} )
8
8
9
- if ("${SIA_ARCH} " STREQUAL "avr" )
9
+ # FIXME: This is a workaround for Concurrency/CMakeLists.txt setting the GYB_SOURCES in embedded-concurrency
10
+ # Need to figure out why the SIA_ARCH we get from there isn't right, and undo this workaround.
11
+ # Extract first part of the SIA_ARCH (e.g., "x86_64" from "x86_64-apple-macos")
12
+ string (REPLACE "-" ";" SIA_ARCH_LIST "${SIA_ARCH} " )
13
+ list (GET SIA_ARCH_LIST 0 SIA_ARCH_HEAD )
14
+
15
+ if ("${SIA_ARCH_HEAD} " STREQUAL "avr" )
10
16
set ("${var_name} " "${SIA_CASE_16_BIT} " PARENT_SCOPE )
11
- elseif ("${SIA_ARCH } " STREQUAL "i386" OR
12
- "${SIA_ARCH } " STREQUAL "i686" OR
13
- "${SIA_ARCH } " STREQUAL "x86" OR
14
- "${SIA_ARCH } " STREQUAL "armv4t" OR
15
- "${SIA_ARCH } " STREQUAL "armv5" OR
16
- "${SIA_ARCH } " STREQUAL "armv6" OR
17
- "${SIA_ARCH } " STREQUAL "armv6m" OR
18
- "${SIA_ARCH } " STREQUAL "armv7" OR
19
- "${SIA_ARCH } " STREQUAL "armv7k" OR
20
- "${SIA_ARCH } " STREQUAL "arm64_32" OR
21
- "${SIA_ARCH } " STREQUAL "armv7m" OR
22
- "${SIA_ARCH } " STREQUAL "armv7em" OR
23
- "${SIA_ARCH } " STREQUAL "armv7s" OR
24
- "${SIA_ARCH } " STREQUAL "m68k" OR
25
- "${SIA_ARCH } " STREQUAL "riscv32" OR
26
- "${SIA_ARCH } " STREQUAL "wasm32" OR
27
- "${SIA_ARCH } " STREQUAL "powerpc" )
17
+ elseif ("${SIA_ARCH_HEAD } " STREQUAL "i386" OR
18
+ "${SIA_ARCH_HEAD } " STREQUAL "i686" OR
19
+ "${SIA_ARCH_HEAD } " STREQUAL "x86" OR
20
+ "${SIA_ARCH_HEAD } " STREQUAL "armv4t" OR
21
+ "${SIA_ARCH_HEAD } " STREQUAL "armv5" OR
22
+ "${SIA_ARCH_HEAD } " STREQUAL "armv6" OR
23
+ "${SIA_ARCH_HEAD } " STREQUAL "armv6m" OR
24
+ "${SIA_ARCH_HEAD } " STREQUAL "armv7" OR
25
+ "${SIA_ARCH_HEAD } " STREQUAL "armv7k" OR
26
+ "${SIA_ARCH_HEAD } " STREQUAL "arm64_32" OR
27
+ "${SIA_ARCH_HEAD } " STREQUAL "armv7m" OR
28
+ "${SIA_ARCH_HEAD } " STREQUAL "armv7em" OR
29
+ "${SIA_ARCH_HEAD } " STREQUAL "armv7s" OR
30
+ "${SIA_ARCH_HEAD } " STREQUAL "m68k" OR
31
+ "${SIA_ARCH_HEAD } " STREQUAL "riscv32" OR
32
+ "${SIA_ARCH_HEAD } " STREQUAL "wasm32" OR
33
+ "${SIA_ARCH_HEAD } " STREQUAL "powerpc" )
28
34
set ("${var_name} " "${SIA_CASE_32_BIT} " PARENT_SCOPE )
29
- elseif ("${SIA_ARCH } " STREQUAL "x86_64" OR
30
- "${SIA_ARCH } " STREQUAL "amd64" OR
31
- "${SIA_ARCH } " STREQUAL "arm64" OR
32
- "${SIA_ARCH } " STREQUAL "arm64e" OR
33
- "${SIA_ARCH } " STREQUAL "aarch64" OR
34
- "${SIA_ARCH } " STREQUAL "powerpc64" OR
35
- "${SIA_ARCH } " STREQUAL "powerpc64le" OR
36
- "${SIA_ARCH } " STREQUAL "s390x" OR
37
- "${SIA_ARCH } " STREQUAL "riscv64" OR
38
- "${SIA_ARCH } " STREQUAL "wasm64" )
35
+ elseif ("${SIA_ARCH_HEAD } " STREQUAL "x86_64" OR
36
+ "${SIA_ARCH_HEAD } " STREQUAL "amd64" OR
37
+ "${SIA_ARCH_HEAD } " STREQUAL "arm64" OR
38
+ "${SIA_ARCH_HEAD } " STREQUAL "arm64e" OR
39
+ "${SIA_ARCH_HEAD } " STREQUAL "aarch64" OR
40
+ "${SIA_ARCH_HEAD } " STREQUAL "powerpc64" OR
41
+ "${SIA_ARCH_HEAD } " STREQUAL "powerpc64le" OR
42
+ "${SIA_ARCH_HEAD } " STREQUAL "s390x" OR
43
+ "${SIA_ARCH_HEAD } " STREQUAL "riscv64" OR
44
+ "${SIA_ARCH_HEAD } " STREQUAL "wasm64" )
39
45
set ("${var_name} " "${SIA_CASE_64_BIT} " PARENT_SCOPE )
40
46
else ()
41
- message (FATAL_ERROR "Unknown architecture: ${SIA_ARCH} " )
47
+ message (FATAL_ERROR "Unknown architecture: ${SIA_ARCH_HEAD} (prefix of ${SIA} ) " )
42
48
endif ()
43
49
endfunction ()
44
50
0 commit comments