Fix nuget build error (#6009)

This commit is contained in:
Ryan Lai 2020-12-03 09:28:39 -08:00 committed by GitHub
parent 2b35f7d4f6
commit 2878e8eb2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.0)
#
# id : package id
# out : name of variable to set result
function(pkg_version id out packages_config)
function(package_version id out packages_config)
file(READ ${packages_config} packages_config_contents)
string(REGEX MATCH "package[ ]*id[ ]*=[ ]*\"${id}\"" found_package_id ${packages_config_contents})
if (NOT(found_package_id))
@ -32,8 +32,8 @@ function(
# Retrieve the latest version of nuget
include(ExternalProject)
ExternalProject_Add(nuget
PREFIX nuget
ExternalProject_Add(nuget_exe
PREFIX nuget_exe
URL "https://dist.nuget.org/win-x86-commandline/v5.3.0/nuget.exe"
DOWNLOAD_NO_EXTRACT 1
CONFIGURE_COMMAND ""
@ -49,9 +49,9 @@ function(
add_custom_command(
OUTPUT ${target_dependency}
DEPENDS ${PACKAGES_CONFIG} ${NUGET_CONFIG}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/nuget/src/nuget restore ${PACKAGES_CONFIG} -PackagesDirectory ${PACKAGES_DIR} -ConfigFile ${NUGET_CONFIG}
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/nuget_exe/src/nuget restore ${PACKAGES_CONFIG} -PackagesDirectory ${PACKAGES_DIR} -ConfigFile ${NUGET_CONFIG}
VERBATIM)
add_custom_target(${nuget_target} DEPENDS ${target_dependency})
add_dependencies(${nuget_target} nuget)
add_dependencies(${nuget_target} nuget_exe)
endfunction()

View file

@ -28,7 +28,7 @@ set(winml_lib_common_dir ${REPO_ROOT}/winml/lib/common)
set(winml_lib_telemetry_dir ${REPO_ROOT}/winml/lib/telemetry)
# Retrieve the version of cppwinrt nuget
pkg_version(
package_version(
Microsoft.Windows.CppWinRT
CppWinRT_version
${PROJECT_SOURCE_DIR}/../packages.config