@@ -73,6 +73,7 @@ usage()
7373 echo " --cmakeargs User-settable additional arguments passed to CMake."
7474 echo " --gcc Optional argument to build using gcc in PATH (default)."
7575 echo " --gccx.y Optional argument to build using gcc version x.y."
76+ echo " --portablebuild Optional argument: set to false to force a non-portable build."
7677 echo " "
7778
7879 echo " Command line arguments starting with '/p:' are passed through to MSBuild."
@@ -121,9 +122,7 @@ initDistroRid()
121122 local targetOs=" $1 "
122123 local buildArch=" $2 "
123124 local isCrossBuild=" $3 "
124- # For RID calculation purposes, say we are always a portable build
125- # All of our packages that use the distro rid (CoreCLR packages) are portable.
126- local isPortableBuild=1
125+ local isPortableBuild=" $4 "
127126
128127 # Only pass ROOTFS_DIR if __DoCrossArchBuild is specified.
129128 if (( isCrossBuild == 1 )) ; then
@@ -141,6 +140,7 @@ arguments=''
141140cmakeargs=' '
142141extraargs=' '
143142crossBuild=0
143+ portableBuild=1
144144
145145source $scriptroot /native/init-os-and-arch.sh
146146
@@ -361,6 +361,19 @@ while [[ $# > 0 ]]; do
361361 shift 1
362362 ;;
363363
364+ -portablebuild)
365+ if [ -z ${2+x} ]; then
366+ echo " No value for portablebuild is supplied. See help (--help) for supported values." 1>&2
367+ exit 1
368+ fi
369+ passedPortable=" $( echo " $2 " | awk ' {print tolower($0)}' ) "
370+ if [ " $passedPortable " = false ]; then
371+ portableBuild=0
372+ arguments=" $arguments /p:PortableBuild=false"
373+ fi
374+ shift 2
375+ ;;
376+
364377 * )
365378 extraargs=" $extraargs $1 "
366379 shift 1
@@ -372,7 +385,7 @@ if [ ${#actInt[@]} -eq 0 ]; then
372385 arguments=" -restore -build $arguments "
373386fi
374387
375- initDistroRid $os $arch $crossBuild
388+ initDistroRid $os $arch $crossBuild $portableBuild
376389
377390# URL-encode space (%20) to avoid quoting issues until the msbuild call in /eng/common/tools.sh.
378391# In *proj files (XML docs), URL-encoded string are rendered in their decoded form.
0 commit comments