Skip to content

Commit 89b9846

Browse files
authored
Merge pull request dotnet/corefx#10522 from hseok-oh/enableCross
set __CrossBuild in src/Native/build-native.sh automatically Commit migrated from dotnet/corefx@6750e2b
2 parents fd3b27b + 89aaa95 commit 89b9846

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/libraries/Native/build-native.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,27 @@ while :; do
218218
shift
219219
done
220220

221+
# Set cross build
222+
CPUName=$(uname -p)
223+
# Some Linux platforms report unknown for platform, but the arch for machine.
224+
if [ $CPUName == "unknown" ]; then
225+
CPUName=$(uname -m)
226+
fi
227+
case $CPUName in
228+
i686)
229+
if [ $__BuildArch != x86 ]; then
230+
__CrossBuild=1
231+
echo "Set CrossBuild for $__BuildArch build"
232+
fi
233+
;;
234+
x86_64)
235+
if [ $__BuildArch != x64 ]; then
236+
__CrossBuild=1
237+
echo "Set CrossBuild for $__BuildArch build"
238+
fi
239+
;;
240+
esac
241+
221242
# Set the remaining variables based upon the determined build configuration
222243
__IntermediatesDir="$__rootbinpath/obj/$__BuildOS.$__BuildArch.$__BuildType/Native"
223244
__BinDir="$__rootbinpath/$__BuildOS.$__BuildArch.$__BuildType/Native"

0 commit comments

Comments
 (0)