From 39153321d486c6e27081f64887241a1d0e02c5b2 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Tue, 2 Feb 2016 16:08:58 -0800 Subject: [PATCH] Add CMake project to build Windows powershell.exe --- src/powershell-native/CMakeLists.txt | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/powershell-native/CMakeLists.txt diff --git a/src/powershell-native/CMakeLists.txt b/src/powershell-native/CMakeLists.txt new file mode 100644 index 0000000000..07da7e2379 --- /dev/null +++ b/src/powershell-native/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 2.8.4) +project(PowerShell) + +add_compile_options() + +include_directories( + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshcommon) + +link_directories( + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshcommon) + +add_definitions(-DUNICODE) +add_definitions(-D_UNICODE) + +add_executable(powershell WIN32 + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshcommon/ConfigFileReader.cpp + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshcommon/pwrshcommon.cpp + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshcommon/WinSystemCallFacade.cpp + + ../../src/monad/monad/nttargets/assemblies/nativemsh/pwrshexe/MainEntry.cpp) + +# This subsystem definition is using old policy. TODO: figure out for release and the rest +set_target_properties(powershell PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") +set_target_properties(powershell PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE") +set_target_properties(powershell PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:CONSOLE") +set_target_properties(powershell PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO "_CONSOLE") +set_target_properties(powershell PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") +set_target_properties(powershell PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") + + +target_link_libraries(powershell + mscoree.lib + MUILoad.lib + kernel32.lib + msxml6.lib)