Skip to content

Commit

Permalink
do not pass settings that will not be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
VSadov committed Feb 15, 2021
1 parent 9084edc commit 325bf4d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
4 changes: 0 additions & 4 deletions src/coreclr/build-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,6 @@ __CMakeArgs="-DCLI_CMAKE_HOST_VER=$__host_ver -DCLI_CMAKE_COMMON_HOST_VER=$__app
__CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=$__policy_ver -DCLI_CMAKE_PKG_RID=$__DistroRid -DCLI_CMAKE_COMMIT_HASH=$__commit_hash $__CMakeArgs"
__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"

if [[ "$__PortableBuild" == 1 ]]; then
__CMakeArgs="-DCLI_CMAKE_PORTABLE_BUILD=1 $__CMakeArgs"
fi

if [[ "$__SkipConfigure" == 0 && "$__CodeCoverage" == 1 ]]; then
__CMakeArgs="-DCLR_CMAKE_ENABLE_CODE_COVERAGE=1 $__CMakeArgs"
fi
Expand Down
4 changes: 0 additions & 4 deletions src/native/corehost/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ __CMakeArgs="-DCLI_CMAKE_HOST_POLICY_VER=\"$__policy_ver\" -DCLI_CMAKE_PKG_RID=\
__CMakeArgs="-DRUNTIME_FLAVOR=\"$__RuntimeFlavor\" $__CMakeArgs"
__CMakeArgs="-DFEATURE_DISTRO_AGNOSTIC_SSL=$__PortableBuild $__CMakeArgs"

if [[ "$__PortableBuild" == 1 ]]; then
__CMakeArgs="-DCLI_CMAKE_PORTABLE_BUILD=1 $__CMakeArgs"
fi

# Specify path to be set for CMAKE_INSTALL_PREFIX.
# This is where all built CoreClr libraries will copied to.
__CMakeBinDir="$__BinDir"
Expand Down
86 changes: 47 additions & 39 deletions src/native/corehost/setup.cmake
Original file line number Diff line number Diff line change
@@ -1,44 +1,52 @@
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.

if (CLI_CMAKE_PORTABLE_BUILD)
add_definitions(-DFEATURE_PORTABLE_BUILD=1)
endif ()

if("${CLI_CMAKE_HOST_POLICY_VER}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "Host policy version is not specified")
if(${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
# we are building single file host and hosting components are all statically linked.
# the versioning information is irrelevant and may only come up in tracing.
# so we will use "static"
add_definitions(-DHOST_POLICY_PKG_VER="static")
add_definitions(-DHOST_FXR_PKG_VER="static")
add_definitions(-DHOST_PKG_VER="static")
add_definitions(-DCOMMON_HOST_PKG_VER="static")
add_definitions(-DHOST_POLICY_PKG_NAME="static")
add_definitions(-DHOST_POLICY_PKG_REL_DIR="static")
add_definitions(-DREPO_COMMIT_HASH="static")
else()
add_definitions(-DHOST_POLICY_PKG_VER="${CLI_CMAKE_HOST_POLICY_VER}")
if("${CLI_CMAKE_HOST_POLICY_VER}" STREQUAL "")
message(FATAL_ERROR "Host policy version is not specified")
else()
add_definitions(-DHOST_POLICY_PKG_VER="${CLI_CMAKE_HOST_POLICY_VER}")
endif()

if("${CLI_CMAKE_HOST_FXR_VER}" STREQUAL "")
message(FATAL_ERROR "Host FXR version is not specified")
else()
add_definitions(-DHOST_FXR_PKG_VER="${CLI_CMAKE_HOST_FXR_VER}")
endif()

if("${CLI_CMAKE_HOST_VER}" STREQUAL "")
message(FATAL_ERROR "Dotnet host version is not specified")
else()
add_definitions(-DHOST_PKG_VER="${CLI_CMAKE_HOST_VER}")
endif()

if("${CLI_CMAKE_COMMON_HOST_VER}" STREQUAL "")
message(FATAL_ERROR "Common host version is not specified")
else()
add_definitions(-DCOMMON_HOST_PKG_VER="${CLI_CMAKE_COMMON_HOST_VER}")
endif()

if("${CLI_CMAKE_PKG_RID}" STREQUAL "")
message(FATAL_ERROR "A minimum supported package rid is not specified (ex: win7-x86 or ubuntu.14.04-x64, osx.10.12-x64, rhel.7-x64)")
else()
add_definitions(-DHOST_POLICY_PKG_NAME="runtime.${CLI_CMAKE_PKG_RID}.Microsoft.NETCore.DotNetHostPolicy")
add_definitions(-DHOST_POLICY_PKG_REL_DIR="runtimes/${CLI_CMAKE_PKG_RID}/native")
endif()

if("${CLI_CMAKE_COMMIT_HASH}" STREQUAL "")
message(FATAL_ERROR "Commit hash needs to be specified to build the host")
else()
add_definitions(-DREPO_COMMIT_HASH="${CLI_CMAKE_COMMIT_HASH}")
endif()
endif()

if("${CLI_CMAKE_HOST_FXR_VER}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "Host FXR version is not specified")
else()
add_definitions(-DHOST_FXR_PKG_VER="${CLI_CMAKE_HOST_FXR_VER}")
endif()

if("${CLI_CMAKE_HOST_VER}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "Dotnet host version is not specified")
else()
add_definitions(-DHOST_PKG_VER="${CLI_CMAKE_HOST_VER}")
endif()

if("${CLI_CMAKE_COMMON_HOST_VER}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "Common host version is not specified")
else()
add_definitions(-DCOMMON_HOST_PKG_VER="${CLI_CMAKE_COMMON_HOST_VER}")
endif()

if("${CLI_CMAKE_PKG_RID}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "A minimum supported package rid is not specified (ex: win7-x86 or ubuntu.14.04-x64, osx.10.12-x64, rhel.7-x64)")
else()
add_definitions(-DHOST_POLICY_PKG_NAME="runtime.${CLI_CMAKE_PKG_RID}.Microsoft.NETCore.DotNetHostPolicy")
add_definitions(-DHOST_POLICY_PKG_REL_DIR="runtimes/${CLI_CMAKE_PKG_RID}/native")
endif()

if("${CLI_CMAKE_COMMIT_HASH}" STREQUAL "" AND NOT ${CLR_CMAKE_BUILD_SUBSET_RUNTIME})
message(FATAL_ERROR "Commit hash needs to be specified to build the host")
else()
add_definitions(-DREPO_COMMIT_HASH="${CLI_CMAKE_COMMIT_HASH}")
endif()

0 comments on commit 325bf4d

Please sign in to comment.