summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorPat Gavlin <pagavlin@microsoft.com>2015-11-08 20:00:30 -0800
committerPat Gavlin <pagavlin@microsoft.com>2015-11-09 07:32:25 -0800
commitdc0c7c457386bf666f41dd579836d9558a8f5775 (patch)
tree1df37dd3b21d526ad8b02859e4e919c24e7cce4b /build.sh
parenta72f38249d416b02abaa95e6cf0d61da06d7692e (diff)
downloadcoreclr-dc0c7c457386bf666f41dd579836d9558a8f5775.tar.gz
coreclr-dc0c7c457386bf666f41dd579836d9558a8f5775.tar.bz2
coreclr-dc0c7c457386bf666f41dd579836d9558a8f5775.zip
Add support for ninja to the CoreCLR build.
Just what it says on the tin.
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index 80e5a20aae..52bfe131f9 100755
--- a/build.sh
+++ b/build.sh
@@ -2,12 +2,13 @@
usage()
{
- echo "Usage: $0 [BuildArch] [BuildType] [clean] [verbose] [coverage] [cross] [clangx.y] [skipcoreclr] [skipmscorlib] [skiptests]"
+ echo "Usage: $0 [BuildArch] [BuildType] [clean] [verbose] [coverage] [cross] [clangx.y] [ninja] [skipcoreclr] [skipmscorlib] [skiptests]"
echo "BuildArch can be: x64, ARM"
echo "BuildType can be: Debug, Release"
echo "clean - optional argument to force a clean build."
echo "verbose - optional argument to enable verbose build output."
echo "coverage - optional argument to enable code coverage build (currently supported only for Linux and OSX)."
+ echo "ninja - target ninja instead of GNU make"
echo "clangx.y - optional argument to build using clang version x.y."
echo "cross - optional argument to signify cross compilation,"
echo " - will use ROOTFS_DIR environment variable if set."
@@ -68,13 +69,22 @@ build_coreclr()
echo "Commencing build of native components for $__BuildOS.$__BuildArch.$__BuildType"
cd "$__IntermediatesDir"
+ generator=""
+ buildFile="Makefile"
+ buildTool="make"
+ if [ $__UseNinja == 1 ]; then
+ generator="ninja"
+ buildFile="build.ninja"
+ buildTool="ninja"
+ fi
+
# Regenerate the CMake solution
echo "Invoking cmake with arguments: \"$__ProjectRoot\" $__BuildType $__CodeCoverage"
- "$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests
+ "$__ProjectRoot/src/pal/tools/gen-buildsys-clang.sh" "$__ProjectRoot" $__ClangMajorVersion $__ClangMinorVersion $__BuildArch $__BuildType $__CodeCoverage $__IncludeTests $generator
# Check that the makefiles were created.
- if [ ! -f "$__IntermediatesDir/Makefile" ]; then
+ if [ ! -f "$__IntermediatesDir/$buildFile" ]; then
echo "Failed to generate native component build project!"
exit 1
fi
@@ -92,7 +102,7 @@ build_coreclr()
echo "Executing make install -j $NumProc $__UnprocessedBuildArgs"
- make install -j $NumProc $__UnprocessedBuildArgs
+ $buildTool install -j $NumProc $__UnprocessedBuildArgs
if [ $? != 0 ]; then
echo "Failed to build coreclr components."
exit 1
@@ -219,6 +229,7 @@ __RootBinDir="$__ProjectDir/bin"
__LogsDir="$__RootBinDir/Logs"
__UnprocessedBuildArgs=
__MSBCleanBuildArgs=
+__UseNinja=false
__SkipCoreCLR=false
__SkipMSCorLib=false
__CleanBuild=false
@@ -281,6 +292,9 @@ for i in "$@"
__ClangMajorVersion=3
__ClangMinorVersion=7
;;
+ ninja)
+ __UseNinja=1
+ ;;
skipcoreclr)
__SkipCoreCLR=1
;;