Handle --configuration in src/corehost/build.sh correctly (dotnet/core-setup#4389)
authorOmair Majid <omajid@redhat.com>
Fri, 10 Aug 2018 13:55:04 +0000 (09:55 -0400)
committerDavis Goodin <dagood@users.noreply.github.com>
Fri, 10 Aug 2018 13:55:04 +0000 (08:55 -0500)
Currently, the value of the configuration is ignored.

Commit migrated from https://github.com/dotnet/core-setup/commit/086fb54ddbe3b1f723258d56e7dcb69f893c25d9

src/installer/corehost/build.sh

index 83a71dd..ff0461f 100755 (executable)
@@ -58,9 +58,10 @@ init_rid_plat()
 
 usage()
 {
-    echo "Usage: $0 --arch <Architecture> --hostver <Dotnet exe version> --apphostver <app host exe version> --fxrver <HostFxr library version> --policyver <HostPolicy library version> --commithash <Git commit hash> [--xcompiler <Cross C++ Compiler>]"
+    echo "Usage: $0 --configuration <configuration> --arch <Architecture> --hostver <Dotnet exe version> --apphostver <app host exe version> --fxrver <HostFxr library version> --policyver <HostPolicy library version> --commithash <Git commit hash> [--xcompiler <Cross C++ Compiler>]"
     echo ""
     echo "Options:"
+    echo "  --configuration <configuration>   Build configuration (Debug, Release)"
     echo "  --arch <Architecture>             Target Architecture (x64, x86, arm, arm64, armel)"
     echo "  --hostver <Dotnet host version>   Version of the dotnet executable"
     echo "  --apphostver <app host version>   Version of the apphost executable"
@@ -96,7 +97,7 @@ __commit_hash=
 __portableBuildArgs=
 __configuration=Debug
 __linkPortable=0
-__cmake_defines="-DCMAKE_BUILD_TYPE=${__configuration} ${__portableBuildArgs}"
+__cmake_defines=
 __baseIntermediateOutputPath="$RootRepo/Bin/obj"
 __versionSourceFile="$__baseIntermediateOutputPath/version.cpp"
 
@@ -151,6 +152,8 @@ while [ "$1" != "" ]; do
     shift
 done
 
+__cmake_defines="${__cmake_defines} -DCMAKE_BUILD_TYPE=${__configuration} ${__portableBuildArgs}"
+
 mkdir -p "$__baseIntermediateOutputPath"
 
 case $__build_arch in