From 5baa2d6fe60e13327af788b08ebfb9286f4277c7 Mon Sep 17 00:00:00 2001 From: Mike Richmond Date: Wed, 10 Aug 2016 21:45:45 -0700 Subject: [PATCH] Fixing onecore.lib link issue --- .../nativemsh/pwrshexe/CMakeLists.txt | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt b/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt index 49937272a..149f1048e 100644 --- a/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt +++ b/src/powershell-native/nativemsh/pwrshexe/CMakeLists.txt @@ -12,10 +12,25 @@ if (BUILD_ONECORE) ${STATIC_MT_CRT_LIB} ${STATIC_MT_VCRT_LIB} ) - set(powershell_definitions - _CONSOLE - CORECLR - ) + set(powershell_definitions + _CONSOLE + CORECLR + ) + + # + # Configure lib directories so that CI picks up onecore.lib + # + SET (WindowsSdkDir $ENV{WindowsSdkDir}) + SET (WindowsSDKVersion $ENV{WindowsSDKVersion}) + SET (WindowsSDKLibBase "${WindowsSdkDir}/Lib/${WindowsSDKVersion}") + SET (OneCoreLibBase "$ENV{VCInstallDir}lib/onecore/amd64") + + SET (LibraryPath) + list (APPEND LibraryPath "${OneCoreLibBase}") + list (APPEND LibraryPath "${WindowsSDKLibBase}ucrt/${WindowsSDKPlatform}") + list (APPEND LibraryPath "${WindowsSDKLibBase}um/${WindowsSDKPlatform}" ) + link_directories(${LibraryPath}) + else () # Settings to use when creating PowerShell.exe for Windows on full SKUs or downlevel platforms set(PWRSHEXE_WINDOWS_SOURCES