Simplify build script a bit
#!/bin/bash
set -eu -o pipefail
-# bootstrap
+# bootstrap with 0.17 which is the last version that doesn't require a host D compiler.
git clone --recursive https://github.com/ldc-developers/ldc.git -b release-0.17.1
-
-# build and install LDC
cd ldc
mkdir build
cd build
-cmake -DCMAKE_INSTALL_PREFIX=$SRC_DIR/install ..
-make && make install
-cd ..
-
-# build and install rdmd
-curl -L -O https://raw.githubusercontent.com/D-Programming-Language/tools/2.064/rdmd.d
-$SRC_DIR/install/bin/ldmd2 rdmd.d
-cp rdmd $SRC_DIR/install/bin
-
+cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$SRC_DIR/install -DCMAKE_PREFIX_PATH=$PREFIX ..
+ninja install
cd $SRC_DIR
rm -rf ldc
-# end bootstrap
-
# build
-HOST_LDMD=$SRC_DIR/install/bin/ldmd2
mkdir build
cd build
cmake -G Ninja \
@@ -31,9 +19,9 @@ cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DBUILD_SHARED_LIBS=ON \
- -DD_COMPILER=$HOST_LDMD \
- $BOOTSTRAP_CMAKE_FLAGS
+ -DD_COMPILER=$SRC_DIR/install/bin/ldmd2 \
..
+
ninja install
ldc2 -version
