lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master f8a78ba 15/30: Add a CI build using clang wit


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f8a78ba 15/30: Add a CI build using clang with autotools too
Date: Wed, 24 Mar 2021 15:31:09 -0400 (EDT)

branch: master
commit f8a78baf03860a8cacc1bf9cb006c4a764cf017f
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Add a CI build using clang with autotools too
    
    Note that the build also uses libc++, rather than libstdc++ that clang
    under Linux uses by default, to test not only another compiler, but also
    another standard library implementation.
    
    And also because compiling unwind.cpp with clang/libstdc++ doesn't work
    currently (while when using libc++ this file is not compiled at all).
---
 .github/workflows/ci.yml | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c8aeb79..9fe3c6d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,8 +25,12 @@ jobs:
           - name: Linux using autotools
             mingw: false
             autotools: true
+          - name: Linux with clang
+            compiler: clang
+            mingw: false
+            autotools: true
     env:
-      LMI_COMPILER: gcc
+      LMI_COMPILER: ${{ matrix.compiler || 'gcc' }}
       LMI_TRIPLET: ${{ matrix.triplet || 'x86_64-pc-linux-gnu' }}
 
     steps:
@@ -66,6 +70,10 @@ jobs:
             packages="$packages libunwind-dev libdw-dev libgtk-3-dev"
           fi
 
+          if [ "${{ matrix.compiler }}" = clang ]; then
+            packages="$packages clang libc++abi-dev libc++-dev"
+          fi
+
           sudo apt-get -qq install $packages
 
       - name: Fix up libtool
@@ -81,6 +89,12 @@ jobs:
           else
             compiler=${LMI_COMPILER}
           fi
+
+          if [ "${{ matrix.compiler }}" = clang ]; then
+            echo "CC=clang" >> $GITHUB_ENV
+            echo "CXX=clang++ -stdlib=libc++" >> $GITHUB_ENV
+          fi
+
           gcc_version=$($compiler -dumpversion|tr -d '\r')
           echo "gcc_version=$gcc_version" >> $GITHUB_ENV
 
@@ -145,7 +159,7 @@ jobs:
         run: |
           for lib in regex filesystem; do
             cd /opt/lmi/third_party/src/boost/libs/${lib}/src
-            ${LMI_COMPILER} -std=c++17 -Wno-deprecated-declarations 
-DBOOST_NO_AUTO_PTR -Dregister='' -fPIC -I../../.. -c *.cpp
+            ${CXX-${LMI_COMPILER}} -std=c++17 -Wno-deprecated-declarations 
-DBOOST_NO_AUTO_PTR -Dregister='' -fPIC -I../../.. -c *.cpp
             ar rc 
/opt/lmi/local/${LMI_COMPILER}_${LMI_TRIPLET}/lib/libboost_${lib}.a *.o
           done
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]