File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ for sdk in $SDKS_ORDERED; do
74
74
# Clear the cmake file of this unsupported platform and loop
75
75
echo " unsupported"
76
76
# Disable the unsupported platform and leave a note
77
- sed -i " " -E -e " s/^([ \t]*)($CMAKE_DEPENDS_NAME [$sdk ]).*$/\1# \2 # unsupported platform/" " $CMAKE_PATH "
77
+ sed -i " " -E -e " s/^([ \t]*)($CMAKE_DEPENDS_NAME [$sdk ]) .*$/\1# \2 # unsupported platform/" " $CMAKE_PATH "
78
78
continue
79
79
fi
80
80
@@ -93,16 +93,17 @@ for sdk in $SDKS_ORDERED; do
93
93
DEPENDS_ON=(" ${(@ )DEPENDS_ON:# XPC} " )
94
94
fi
95
95
96
- # Foundation depends on CoreGraphics in the .swift code.
97
- # Hardcode the dependency.
98
- if [[ " $1 " == " Foundation" ]]; then
99
- DEPENDS_ON+=" CoreGraphics"
100
- fi
101
-
102
-
103
96
echo " $DEPENDS_ON "
104
97
if [[ $UPDATE_CMAKE == 1 ]]; then
105
- sed -i " " -E -e " s/^([ \t]*$CMAKE_DEPENDS_NAME [$sdk ]).*$/\1 $DEPENDS_ON # auto-updated/" " $CMAKE_PATH "
98
+ # Get existing list; only update if there is a difference.
99
+ orig=" $( sed -E -n -e " s/^([ \t]*$CMAKE_DEPENDS_NAME [$sdk ]) ([^#]*)(#.*)?$/\2/p" " $CMAKE_PATH " | sed ' s/ *$//' ) "
100
+ if [ -z " $orig " ]; then
101
+ echo " \twarning: Cannot find $CMAKE_DEPENDS_NAME [$sdk ] declaration"
102
+ fi
103
+ diff=" $( echo " $orig " " $DEPENDS_ON " | tr ' ' ' \n' | sort | uniq -u) "
104
+ if [ -n " $diff " ]; then
105
+ sed -i " " -E -e " s/^([ \t]*$CMAKE_DEPENDS_NAME [$sdk ]) .*$/\1 $DEPENDS_ON # auto-updated/" " $CMAKE_PATH "
106
+ fi
106
107
fi
107
108
done
108
109
echo # newline
You can’t perform that action at this time.
0 commit comments