Add pwrshplugin to cmake build

This commit is contained in:
Sergei Vorobev 2016-06-16 16:43:51 -07:00
parent 299d7798ce
commit d24bf35c22
4 changed files with 52 additions and 6 deletions

View File

@ -93,6 +93,13 @@ function Start-PSBuild {
}
$precheck = $precheck -and (precheck 'msbuild' 'msbuild not found. Install Visual Studio 2015.')
#mc.exe is Message Compiler for native resources
$mcexe = Get-ChildItem "${env:ProgramFiles(x86)}\Microsoft SDKs\Windows\" -Recurse -Filter 'mc.exe' | ? {$_.FullName -match 'x64'} | select -First 1 | % {$_.FullName}
if (-not $mcexe) {
throw 'mc.exe not found. Install Microsoft Windows SDK.'
}
} elseif ($IsLinux -or $IsOSX) {
$InstallCommand = if ($IsLinux) {
'apt-get'
@ -182,6 +189,14 @@ function Start-PSBuild {
try {
Push-Location "$PSScriptRoot\src\powershell-native"
# Compile native resources
@("nativemsh/pwrshplugin") | % {
$nativeResourcesFolder = $_
Get-ChildItem $nativeResourcesFolder -Filter "*.mc" | % {
& $mcexe -c -U $_.FullName -h $nativeResourcesFolder -r $nativeResourcesFolder
}
}
if ($cmakeGenerator) {
cmake -G $cmakeGenerator .
} else {
@ -189,6 +204,7 @@ function Start-PSBuild {
}
Start-NativeExecution { msbuild powershell.vcxproj /p:Configuration=$msbuildConfiguration }
Start-NativeExecution { msbuild pwrshmsg.vcxproj /p:Configuration=$msbuildConfiguration }
} finally {
Pop-Location

View File

@ -8,6 +8,11 @@ x64/
ZERO_CHECK.vcxproj
ZERO_CHECK.vcxproj.filters
cmake_install.cmake
powershell.dir/
powershell.vcxproj
powershell.vcxproj.filters
*.dir/
*.vcxproj
*.vcxproj.filters
# Resources
MSG*.bin
pwrshpluginerrorcodes.h
pwrshpluginerrorcodes.rc

View File

@ -16,7 +16,8 @@ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
include_directories(
nativemsh/pwrshcommon)
nativemsh/pwrshcommon
nativemsh/pwrshplugin)
link_directories(
nativemsh/pwrshcommon)
@ -27,9 +28,14 @@ add_definitions(-D_UNICODE)
add_executable(powershell WIN32
nativemsh/pwrshcommon/pwrshcommon.cpp
nativemsh/pwrshcommon/WinSystemCallFacade.cpp
nativemsh/pwrshexe/MainEntry.cpp)
add_library(pwrshmsg
nativemsh/pwrshplugin/entrypoints.cpp
nativemsh/pwrshplugin/pwrshclrhost.cpp
nativemsh/pwrshplugin/pwrshpluginerrorcodes.mc
nativemsh/pwrshplugin/pwrshpluginerrorcodes.rc)
# This subsystem definition is using old policy. TODO: figure out for release and the rest
set_target_properties(powershell PROPERTIES COMPILE_DEFINITIONS "_CONSOLE")
set_target_properties(powershell PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE")
@ -44,3 +50,11 @@ target_link_libraries(powershell
kernel32.lib
msxml6.lib
legacy_stdio_definitions.lib)
target_link_libraries(pwrshmsg
mscoree.lib
MUILoad.lib
kernel32.lib
msxml6.lib
legacy_stdio_definitions.lib)

View File

@ -8,5 +8,16 @@
"monad/nttargets/assemblies/nativemsh/pwrshcommon/WinSystemCallFacade.h": "nativemsh/pwrshcommon/WinSystemCallFacade.h",
"monad/nttargets/assemblies/nativemsh/pwrshcommon/IPwrshCommonOutput.h": "nativemsh/pwrshcommon/IPwrshCommonOutput.h",
"monad/nttargets/assemblies/nativemsh/pwrshexe/MainEntry.cpp": "nativemsh/pwrshexe/MainEntry.cpp",
"monad/nttargets/assemblies/nativemsh/pwrshcommon/ClrHostWrapper.h": "nativemsh/pwrshcommon/ClrHostWrapper.h"
"monad/nttargets/assemblies/nativemsh/pwrshcommon/ClrHostWrapper.h": "nativemsh/pwrshcommon/ClrHostWrapper.h",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/entrypoints.cpp": "nativemsh/pwrshplugin/entrypoints.cpp",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshclrhost.cpp": "nativemsh/pwrshplugin/pwrshclrhost.cpp",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshpluginerrorcodes.mc": "nativemsh/pwrshplugin/pwrshpluginerrorcodes.mc",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshpluginResources.rc": "nativemsh/pwrshplugin/pwrshpluginResources.rc",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshplugin.dll.manifest": "nativemsh/pwrshplugin/pwrshplugin.dll.manifest",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/version.rc": "nativemsh/pwrshplugin/version.rc",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/entrypoints.h": "nativemsh/pwrshplugin/entrypoints.h",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshclrhost.h": "nativemsh/pwrshplugin/pwrshclrhost.h",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshheaders.h": "nativemsh/pwrshplugin/pwrshheaders.h",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshplugin.h": "nativemsh/pwrshplugin/pwrshplugin.h",
"monad/nttargets/assemblies/nativemsh/pwrshplugin/pwrshplugindefs.h": "nativemsh/pwrshplugin/pwrshplugindefs.h"
}