Skip to content

Commit 4c4bdf2

Browse files
committed
Upgraded compilers and CMake minimal versions
1 parent f965b26 commit 4c4bdf2

File tree

4 files changed

+28
-37
lines changed

4 files changed

+28
-37
lines changed

.github/workflows/linux.yml

Lines changed: 24 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,41 @@ defaults:
1212
shell: bash -e -l {0}
1313
jobs:
1414
build:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-24.04
1616
name: ${{ matrix.sys.compiler }} ${{ matrix.sys.version }}
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
sys:
21-
- {compiler: gcc, version: '8'}
22-
- {compiler: gcc, version: '9'}
23-
- {compiler: gcc, version: '10'}
2421
- {compiler: gcc, version: '11'}
25-
- {compiler: clang, version: '15'}
26-
- {compiler: clang, version: '16'}
22+
- {compiler: gcc, version: '12'}
23+
- {compiler: gcc, version: '13'}
24+
- {compiler: gcc, version: '14'}
25+
- {compiler: clang, version: '19'}
26+
- {compiler: clang, version: '20'}
2727

2828
steps:
2929

30-
- name: Setup GCC
31-
if: ${{ matrix.sys.compiler == 'gcc' }}
32-
run: |
33-
GCC_VERSION=${{ matrix.sys.version }}
34-
sudo apt-get update
35-
sudo apt-get --no-install-suggests --no-install-recommends install g++-$GCC_VERSION
36-
CC=gcc-$GCC_VERSION
37-
echo "CC=$CC" >> $GITHUB_ENV
38-
CXX=g++-$GCC_VERSION
39-
echo "CXX=$CXX" >> $GITHUB_ENV
30+
- name: Install GCC
31+
if: matrix.sys.compiler == 'gcc'
32+
uses: egor-tensin/setup-gcc@v1
33+
with:
34+
version: ${{matrix.sys.version}}
35+
platform: x64
4036

41-
- name: Setup clang
42-
if: ${{ matrix.sys.compiler == 'clang' }}
37+
- name: Install LLVM and Clang
38+
if: matrix.sys.compiler == 'clang'
4339
run: |
44-
LLVM_VERSION=${{ matrix.sys.version }}
45-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
46-
if [[ $LLVM_VERSION -ge 13 ]]; then
47-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-$LLVM_VERSION main" || exit 1
48-
else
49-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" || exit 1
50-
fi || exit 1
51-
sudo apt-get update || exit 1
52-
sudo apt-get --no-install-suggests --no-install-recommends install clang-$LLVM_VERSION || exit 1
53-
sudo apt-get --no-install-suggests --no-install-recommends install g++-9 g++-9-multilib || exit 1
54-
sudo ln -s /usr/include/asm-generic /usr/include/asm
55-
CC=clang-$LLVM_VERSION
56-
echo "CC=$CC" >> $GITHUB_ENV
57-
CXX=clang++-$LLVM_VERSION
58-
echo "CXX=$CXX" >> $GITHUB_ENV
40+
wget https://apt.llvm.org/llvm.sh
41+
chmod +x llvm.sh
42+
sudo ./llvm.sh ${{matrix.sys.version}}
43+
sudo apt-get install -y clang-tools-${{matrix.sys.version}}
44+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${{matrix.sys.version}} 200
45+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${{matrix.sys.version}} 200
46+
sudo update-alternatives --install /usr/bin/clang-scan-deps clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}} 200
47+
sudo update-alternatives --set clang /usr/bin/clang-${{matrix.sys.version}}
48+
sudo update-alternatives --set clang++ /usr/bin/clang++-${{matrix.sys.version}}
49+
sudo update-alternatives --set clang-scan-deps /usr/bin/clang-scan-deps-${{matrix.sys.version}}
5950
6051
- name: Checkout code
6152
uses: actions/checkout@v3

.github/workflows/osx.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
os:
21-
- 11
22-
- 12
21+
- 14
22+
- 15
2323

2424
steps:
2525

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.15..3.29)
1111
project(xtensor-r)
1212

1313
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# The full license is in the file LICENSE, distributed with this software. #
88
############################################################################
99

10-
cmake_minimum_required(VERSION 3.1)
10+
cmake_minimum_required(VERSION 3.15..3.29)
1111

1212
set(CMAKE_MACOSX_RPATH 1)
1313
set(CMAKE_SKIP_BUILD_RPATH FALSE)

0 commit comments

Comments
 (0)