summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Kumar <rahku@microsoft.com>2016-01-13 14:14:46 -0800
committerRahul Kumar <rahku@microsoft.com>2016-01-22 16:14:41 -0800
commita095884c496bf77ff8d2b3f30a567a5cb448873b (patch)
tree2f19e983960752d9084e837fa2e7ccb4317b2f1d
parent0227fbbc42c3df3bd3f9f1b905fe61a6caea1e32 (diff)
downloadcoreclr-a095884c496bf77ff8d2b3f30a567a5cb448873b.tar.gz
coreclr-a095884c496bf77ff8d2b3f30a567a5cb448873b.tar.bz2
coreclr-a095884c496bf77ff8d2b3f30a567a5cb448873b.zip
Use coreclr buildtools nuget package instead of compiling the tools used during build.
This only applies to windows build.
-rw-r--r--CMakeLists.txt4
-rw-r--r--src/.nuget/packages.Windows_NT.config1
-rw-r--r--src/ToolBox/SOS/CMakeLists.txt2
-rw-r--r--src/dlls/mscoree/coreclr/CMakeLists.txt50
-rw-r--r--src/scripts/buildtools/restorebuildtools.bat11
-rw-r--r--src/scripts/buildtools/restorebuildtools.proj8
-rw-r--r--src/tools/CMakeLists.txt5
7 files changed, 44 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 561c4dc8a2..98d3b760d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -794,4 +794,8 @@ if(WIN32)
add_compile_options(/Zl) # omit default library name in .OBJ
endif(WIN32)
+# TODO change version
+set(BuildToolsVersion "1.0.4-prerelease")
+set(BuildToolsDir "${CLR_DIR}/packages/Microsoft.DotNet.BuildTools.CoreCLR.${BuildToolsVersion}")
+
add_subdirectory(src)
diff --git a/src/.nuget/packages.Windows_NT.config b/src/.nuget/packages.Windows_NT.config
index 8e4b319638..d2c4cf51ee 100644
--- a/src/.nuget/packages.Windows_NT.config
+++ b/src/.nuget/packages.Windows_NT.config
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.DotNet.BuildTools" version="1.0.25-prerelease-00121" />
+ <package id="Microsoft.DotNet.BuildTools.CoreCLR" version="1.0.4-prerelease" />
<package id="dnx-coreclr-win-x86" version="1.0.0-rc2-16128" />
</packages>
diff --git a/src/ToolBox/SOS/CMakeLists.txt b/src/ToolBox/SOS/CMakeLists.txt
index 8cc9757140..f48f3a70c1 100644
--- a/src/ToolBox/SOS/CMakeLists.txt
+++ b/src/ToolBox/SOS/CMakeLists.txt
@@ -1,7 +1,5 @@
if(WIN32)
if(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_subdirectory(Strike)
- add_subdirectory(DacTableGen)
- add_subdirectory(diasdk)
endif(NOT DEFINED CLR_CMAKE_PLATFORM_ARCH_ARM64)
endif(WIN32)
diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt
index 777165cb6f..36bc12911e 100644
--- a/src/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/dlls/mscoree/coreclr/CMakeLists.txt
@@ -130,38 +130,28 @@ if(WIN32)
list(APPEND INC_DIR -I${CLR_DIR}/src/vm -I${CLR_DIR}/src/vm/${ARCH_SOURCES_DIR} -I${CLR_DIR}/src/debug/ee -I${CLR_DIR}/src/gc)
list(APPEND PREPROCESS_DEFINITIONS -DDACCESS_COMPILE -DDBG_TARGET_64BIT=1 -DDBG_TARGET_WIN64=1)
-
- if(CLR_CMAKE_PLATFORM_ARCH_ARM64)
- # TODO package these tools into a new buildtool nuget package to get cross compilation support.
-
- #list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM64=1)
- #add_custom_command(TARGET coreclr
- # POST_BUILD
- # COMMAND cl.exe /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
- # COMMAND dactablegen.exe /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
- # COMMAND InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
- # COMMAND GenClrDebugResource.exe /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
- # COMMAND InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
- # COMMENT Add dactable & debug resources to coreclr
- #)
-
- else()
+ if (CLR_CMAKE_PLATFORM_ARCH_AMD64)
list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_AMD64=1)
+ elseif (CLR_CMAKE_PLATFORM_ARCH_ARM64)
+ list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM64=1)
+ elseif (CLR_CMAKE_PLATFORM_ARCH_ARM)
+ list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_ARM=1)
+ elseif (CLR_CMAKE_PLATFORM_ARCH_I386)
+ list(APPEND PREPROCESS_DEFINITIONS -DDBG_TARGET_X86=1)
+ else()
+ clr_unknown_arch()
+ endif()
- add_dependencies(coreclr dactablegen)
-
- add_custom_command(TARGET coreclr
- POST_BUILD
- COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
- COMMAND $<TARGET_FILE:dactablegen_exe> /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
- COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
- COMMAND $<TARGET_FILE:GenClrDebugResource> /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
- COMMAND $<TARGET_FILE:InjectResource> /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
- COMMENT Add dactable & debug resources to coreclr
- )
-
- endif(CLR_CMAKE_PLATFORM_ARCH_ARM64)
-
+ add_custom_command(TARGET coreclr
+ POST_BUILD
+ COMMAND ${CLR_DIR}/src/scripts/buildtools/restorebuildtools.bat
+ COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
+ COMMAND ${BuildToolsDir}/dactablegen.exe /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/coreclr.pdb /dll:$<TARGET_FILE:coreclr> /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
+ COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$<TARGET_FILE:coreclr>
+ COMMAND ${BuildToolsDir}/GenClrDebugResource.exe /dac:$<TARGET_FILE:mscordaccore> /dbi:$<TARGET_FILE:mscordbi> /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
+ COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$<TARGET_FILE:coreclr> /name:CLRDEBUGINFO
+ COMMENT Add dactable & debug resources to coreclr
+ )
else()
add_custom_command(
TARGET coreclr
diff --git a/src/scripts/buildtools/restorebuildtools.bat b/src/scripts/buildtools/restorebuildtools.bat
new file mode 100644
index 0000000000..a07e81759f
--- /dev/null
+++ b/src/scripts/buildtools/restorebuildtools.bat
@@ -0,0 +1,11 @@
+REM =========================================================================================
+REM ===
+REM === Restore build tools required for native build
+REM ===
+REM =========================================================================================
+echo Restore coreclr build tools nuget package
+setlocal
+:: Set the environment for the managed build
+call "%__VSToolsRoot%\VsDevCmd.bat"
+%_msbuildexe% "%~dp0restorebuildtools.proj" /p:OutputPath="%__IntermediatesDir%" /nodeReuse:false
+endlocal \ No newline at end of file
diff --git a/src/scripts/buildtools/restorebuildtools.proj b/src/scripts/buildtools/restorebuildtools.proj
new file mode 100644
index 0000000000..cc6c6d2ba9
--- /dev/null
+++ b/src/scripts/buildtools/restorebuildtools.proj
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\..\..\dir.props" />
+
+ <Import Project="..\..\..\dir.targets" />
+
+ <Import Project="..\..\..\dir.traversal.targets" />
+</Project> \ No newline at end of file
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 87c3eae90f..5443e0ddb6 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -1,6 +1 @@
add_subdirectory(crossgen)
-
-if(WIN32)
- add_subdirectory(GenClrDebugResource)
- add_subdirectory(InjectResource)
-endif(WIN32)