build: Fix finding .NET runtime when there's multiple installed versions
This commit is contained in:
parent
60e7362f4e
commit
cc3a9f1e81
@ -49,13 +49,16 @@ endif()
|
||||
set(CoreClrEmbed_ROOT_PATH "${CORECLR_RUNTIME_ROOT_PATH}")
|
||||
|
||||
|
||||
file(GLOB _CORECLR_HOST_ARCH_PATH "${CORECLR_RUNTIME_ROOT_PATH}/packs/Microsoft.NETCore.App.Host.*-${CORECLR_SUBARCH}")
|
||||
if (_CORECLR_HOST_ARCH_PATH)
|
||||
get_filename_component(_CORECLR_HOST_ARCH_FILENAME ${_CORECLR_HOST_ARCH_PATH} NAME)
|
||||
string(REPLACE "Microsoft.NETCore.App.Host." "" _CORECLR_COMPUTED_ARCH "${_CORECLR_HOST_ARCH_FILENAME}")
|
||||
if (_CORECLR_COMPUTED_ARCH)
|
||||
set(CORECLR_ARCH "${_CORECLR_COMPUTED_ARCH}")
|
||||
endif()
|
||||
file(GLOB _CORECLR_HOST_ARCH_PATH_LIST "${CORECLR_RUNTIME_ROOT_PATH}/packs/Microsoft.NETCore.App.Host.*-${CORECLR_SUBARCH}")
|
||||
if (_CORECLR_HOST_ARCH_PATH_LIST)
|
||||
foreach(_CORECLR_HOST_ARCH_PATH ${_CORECLR_HOST_ARCH_PATH_LIST})
|
||||
get_filename_component(_CORECLR_HOST_ARCH_FILENAME ${_CORECLR_HOST_ARCH_PATH} NAME)
|
||||
string(REPLACE "Microsoft.NETCore.App.Host." "" _CORECLR_COMPUTED_ARCH "${_CORECLR_HOST_ARCH_FILENAME}")
|
||||
if (_CORECLR_COMPUTED_ARCH)
|
||||
set(CORECLR_ARCH "${_CORECLR_COMPUTED_ARCH}")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(CORECLR_HOST_BASE_PATH "${CORECLR_RUNTIME_ROOT_PATH}/packs/Microsoft.NETCore.App.Host.${CORECLR_ARCH}/${CORECLR_RUNTIME_VERSION_FULL}")
|
||||
|
Loading…
Reference in New Issue
Block a user