@@ -51,7 +51,7 @@ function update_cmakelists_source() {
51
51
do
52
52
exts_arg+=(-o -name " ${src_exts[$i]} " )
53
53
done
54
-
54
+
55
55
# Build an array with the rest of the arguments
56
56
shift
57
57
exceptions=(" $@ " )
@@ -85,20 +85,26 @@ function update_cmakelists_assembly() {
85
85
86
86
mac_x86_64_asms=$( $find " ${src_root} " -type f \( -name " *x86_64*" -or -name " *avx2*" \) -name " *apple*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
87
87
linux_x86_64_asms=$( $find " ${src_root} " -type f \( -name " *x86_64*" -or -name " *avx2*" \) -name " *linux*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
88
+ win_x86_64_asms=$( $find " ${src_root} " -type f \( -name " *x86_64*" -or -name " *avx2*" \) -name " *win*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
88
89
mac_aarch64_asms=$( $find " ${src_root} " -type f -name " *armv8*" -name " *apple*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
89
90
linux_aarch64_asms=$( $find " ${src_root} " -type f -name " *armv8*" -name " *linux*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
91
+ win_aarch64_asms=$( $find " ${src_root} " -type f -name " *armv8*" -name " *win*" -name " *.S" -printf ' %P\n' | LC_ALL=POSIX sort)
90
92
log " $mac_x86_64_asms "
91
93
log " $linux_x86_64_asms "
94
+ log " $win_x86_64_asms "
92
95
log " $mac_aarch64_asms "
93
96
log " $linux_aarch64_asms "
94
-
97
+ log " $win_aarch64_asms "
98
+
95
99
# Update list of assembly files in CMakeLists.txt
96
100
# The first part in `BEGIN` (i.e., `undef $/;`) is for working with multi-line;
97
101
# the second is so that we can pass in a variable to replace with.
98
102
perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Darwin([^\)]+)x86_64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Darwin$1x86_64"\)\n target_sources\($2\n$replace/' " $mac_x86_64_asms " " $src_root /CMakeLists.txt"
99
103
perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Linux([^\)]+)x86_64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Linux$1x86_64"\)\n target_sources\($2\n$replace/' " $linux_x86_64_asms " " $src_root /CMakeLists.txt"
104
+ perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Windows([^\)]+)x86_64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Windows$1x86_64"\)\n target_sources\($2\n$replace/' " $win_x86_64_asms " " $src_root /CMakeLists.txt"
100
105
perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Darwin([^\)]+)aarch64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Darwin$1aarch64"\)\n target_sources\($2\n$replace/' " $mac_aarch64_asms " " $src_root /CMakeLists.txt"
101
106
perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Linux([^\)]+)aarch64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Linux$1aarch64"\)\n target_sources\($2\n$replace/' " $linux_aarch64_asms " " $src_root /CMakeLists.txt"
107
+ perl -pi -e ' BEGIN { undef $/; $replace = shift } s/Windows([^\)]+)aarch64"\)\n target_sources\(([^\n]+)\n([^\)]+)/Windows$1aarch64"\)\n target_sources\($2\n$replace/' " $win_aarch64_asms " " $src_root /CMakeLists.txt"
102
108
log " Updated $src_root /CMakeLists.txt"
103
109
}
104
110
@@ -107,7 +113,7 @@ echo "$config" | jq -c '.targets[]' | while read -r target; do
107
113
type=" $( echo " $target " | jq -r .type) "
108
114
exceptions=(" $( echo " $target " | jq -r .exceptions | jq -r @sh) " )
109
115
log " Updating cmake list for ${name} "
110
-
116
+
111
117
case " $type " in
112
118
source)
113
119
update_cmakelists_source " $name " " ${exceptions[@]} "
0 commit comments