summaryrefslogtreecommitdiff
path: root/src/pal/tools/gen-buildsys-clang.sh
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2016-02-08 12:02:20 +0100
committerKamil Rytarowski <n54@gmx.com>2016-02-10 23:44:08 +0100
commitfa6a2ab7f529a7f248a3ed8795ccfe0d6dcd373a (patch)
tree81c8bea294210cedaeed2f096abbe7f4367349fa /src/pal/tools/gen-buildsys-clang.sh
parentf3a008bf45b6cc8c150afd0416da59a5f23573f8 (diff)
downloadcoreclr-fa6a2ab7f529a7f248a3ed8795ccfe0d6dcd373a.tar.gz
coreclr-fa6a2ab7f529a7f248a3ed8795ccfe0d6dcd373a.tar.bz2
coreclr-fa6a2ab7f529a7f248a3ed8795ccfe0d6dcd373a.zip
Add new parameter with settable option: cmakeargs
This will allow to pass user-defined CMake arguments. One of the users is pkgsrc, which defines it to following example string: -DPYVERSSUFFIX:STRING=2.7 -DCMAKE_INSTALL_PREFIX:PATH=/usr/pkg \ -DCMAKE_MODULE_PATH:PATH=/tmp/pkgsrc-tmp/wip/coreclr-git/work/.buildlink/cmake-Modules \ -DCMAKE_SKIP_RPATH:BOOL=TRUE -DCMAKE_INSTALL_LIBDIR:PATH=lib \ -DCMAKE_INSTALL_MANDIR:PATH=man Without these values unmodified build.sh won't integrate with pkgsrc as expected. Solution suggested by Jan Vorli (Microsoft) While there, there was need to alter loop type to handle options passed to arguments. As a bonus, new loop should be POSIX confirming.
Diffstat (limited to 'src/pal/tools/gen-buildsys-clang.sh')
-rwxr-xr-xsrc/pal/tools/gen-buildsys-clang.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pal/tools/gen-buildsys-clang.sh b/src/pal/tools/gen-buildsys-clang.sh
index ea8194fc1f..5e281e492e 100755
--- a/src/pal/tools/gen-buildsys-clang.sh
+++ b/src/pal/tools/gen-buildsys-clang.sh
@@ -3,16 +3,17 @@
# This file invokes cmake and generates the build system for gcc.
#
-if [ $# -lt 4 -o $# -gt 7 ]
+if [ $# -lt 4 -o $# -gt 8 ]
then
echo "Usage..."
- echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> <Architecture> [build flavor] [coverage] [ninja]"
+ echo "gen-buildsys-clang.sh <path to top level CMakeLists.txt> <ClangMajorVersion> <ClangMinorVersion> <Architecture> [build flavor] [coverage] [ninja] [cmakeargs]"
echo "Specify the path to the top level CMake file - <ProjectK>/src/NDP"
echo "Specify the clang version to use, split into major and minor version"
echo "Specify the target architecture."
echo "Optionally specify the build configuration (flavor.) Defaults to DEBUG."
echo "Optionally specify 'coverage' to enable code coverage build."
echo "Target ninja instead of make. ninja must be on the PATH."
+ echo "Pass additional arguments to CMake call."
exit 1
fi
@@ -39,6 +40,7 @@ buildtype=DEBUG
code_coverage=OFF
build_tests=OFF
generator="Unix Makefiles"
+__UnprocessedCMakeArgs=""
for i in "${@:5}"; do
upperI="$(echo $i | awk '{print toupper($0)}')"
@@ -59,7 +61,7 @@ for i in "${@:5}"; do
generator=Ninja
;;
*)
- echo "Ignoring unknown arg '$i'"
+ __UnprocessedCMakeArgs="$__UnprocessedCMakeArgs $i"
esac
done
@@ -144,4 +146,5 @@ cmake \
"-DCMAKE_ENABLE_CODE_COVERAGE=$code_coverage" \
"-DCLR_CMAKE_BUILD_TESTS=$build_tests" \
$cmake_extra_defines \
+ "$__UnprocessedCMakeArgs" \
"$1"