ldc-developers / ldc2.snap

Snap package definition for LDC, the LLVM-based D compiler
11 stars 4 forks source link

Switch to using ninja as the cmake build backend #56

Closed WebDrake closed 6 years ago

WebDrake commented 6 years ago

This should help deal with the LDC 1.9.0 build issues that are seeing 'file truncated' errors crop up (probably because of race conditions between make targets). Since the snapcraft cmake plugin only supports the make backend, we have to create a manual override-build script to run cmake, ninja and ctest.

WebDrake commented 6 years ago

One minor fix to a typo, and this should be good to go:

diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 3813c5d..0909370 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -39,7 +39,7 @@ parts:
         -DD_FLAGS='-w;-flto=thin' \
         -DCMAKE_BUILD_TYPE=Release \
         -DCMAKE_C_FLAGS_RELEASE='-O3 -DNDEBUG -Wa,-mrelax-relocations=no' \
-        -DLLVM_ROOT_DIR=../../llvm/install
+        -DLLVM_ROOT_DIR=../../llvm/install \
         -DBUILD_LTO_LIBS=ON \
         -DLDC_INSTALL_LTOPLUGIN=ON \
         -DMULTILIB=ON \