build-llvm: Enable the custom defaults for Clang when building natively on MSYS2
Normally our releases are cross-built from Linux, but we also support building the toolchain in MSYS2. Enable the custom defaults when building the toolchain in MSYS2 too.
This commit is contained in:
1 parent
4a579e1562
commit
8ee28e2938
1 file changed
+21
-7
+21
-7
@@ -122,6 +122,17 @@ fi
|
|||||||
|
|
||||||
[ -z "$CHECKOUT_ONLY" ] || exit 0
|
[ -z "$CHECKOUT_ONLY" ] || exit 0
|
||||||
|
|
||||||
|
case $(uname) in
|
||||||
|
MINGW*)
|
||||||
|
TARGET_WINDOWS=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ -n "$HOST" ]; then
|
||||||
|
TARGET_WINDOWS=1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if command -v ninja >/dev/null; then
|
if command -v ninja >/dev/null; then
|
||||||
CMAKE_GENERATOR="Ninja"
|
CMAKE_GENERATOR="Ninja"
|
||||||
NINJA=1
|
NINJA=1
|
||||||
@@ -174,13 +185,6 @@ if [ -n "$HOST" ]; then
|
|||||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY"
|
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY"
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY"
|
CMAKEFLAGS="$CMAKEFLAGS -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ONLY"
|
||||||
|
|
||||||
# Custom, llvm-mingw specific defaults. We normally set these in
|
|
||||||
# the frontend wrappers, but this makes sure they are enabled by
|
|
||||||
# default if that wrapper is bypassed as well.
|
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_RTLIB=compiler-rt"
|
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_UNWINDLIB=libunwind"
|
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_CXX_STDLIB=libc++"
|
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_LINKER=lld"
|
|
||||||
BUILDDIR=$BUILDDIR-$HOST
|
BUILDDIR=$BUILDDIR-$HOST
|
||||||
|
|
||||||
if [ -n "$WITH_PYTHON" ]; then
|
if [ -n "$WITH_PYTHON" ]; then
|
||||||
@@ -210,6 +214,16 @@ elif [ -n "$STAGE2" ]; then
|
|||||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_USE_LINKER=lld"
|
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_USE_LINKER=lld"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$TARGET_WINDOWS" ]; then
|
||||||
|
# Custom, llvm-mingw specific defaults. We normally set these in
|
||||||
|
# the frontend wrappers, but this makes sure they are enabled by
|
||||||
|
# default if that wrapper is bypassed as well.
|
||||||
|
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_RTLIB=compiler-rt"
|
||||||
|
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_UNWINDLIB=libunwind"
|
||||||
|
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_CXX_STDLIB=libc++"
|
||||||
|
CMAKEFLAGS="$CMAKEFLAGS -DCLANG_DEFAULT_LINKER=lld"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$LTO" ]; then
|
if [ -n "$LTO" ]; then
|
||||||
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_ENABLE_LTO=$LTO"
|
CMAKEFLAGS="$CMAKEFLAGS -DLLVM_ENABLE_LTO=$LTO"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user