Skip to content

Commit

Permalink
Support older CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
alugowski committed Oct 31, 2023
1 parent be492fb commit 1ecd001
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
with:
version: ${{ matrix.gccver }}

# build on CMake version supported in CMakeLists.txt
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
if: contains(matrix.os, 'ubuntu')
with:
cmake-version: '3.18'

- name: Install Integrations (Ubuntu)
if: contains(matrix.os, 'ubuntu')
run: sudo apt-get update && sudo apt-get install -y libarmadillo-dev
Expand Down Expand Up @@ -73,6 +80,7 @@ jobs:
pythontests:
name: Python ${{ matrix.python-version }} Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
if: false
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -128,6 +136,7 @@ jobs:
linux_32bit:
name: Tests on 32-bit Linux
runs-on: ubuntu-latest
if: false
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.19...3.25) # needed for CheckSourceCompiles
cmake_minimum_required(VERSION 3.18...3.25)

# Read the version from fast_matrix_market.hpp
set(VERSION_HEADER_FILE include/fast_matrix_market/fast_matrix_market.hpp)
Expand Down
2 changes: 1 addition & 1 deletion cmake/GraphBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ find_package(GraphBLAS QUIET MODULE)

# See if GraphBLAS is installed system-wide already
if (NOT GraphBLAS_FOUND)
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <GraphBLAS.h>
int main(void) { return 0; }
" GRAPHBLAS_H_AVAILABLE)
Expand Down
8 changes: 4 additions & 4 deletions cmake/from_chars_tests.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Test for float version of std::from_chars.
# The method is specified in C++17, but compiler support varies.
include(CheckSourceCompiles)
include(CheckCXXSourceCompiles)

# CMP0067: Honor language standard in try_compile() source-file signature.
# https://cmake.org/cmake/help/latest/policy/CMP0067.html
cmake_policy(SET CMP0067 NEW)
set(CMAKE_CXX_STANDARD 17)

# Check for int support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
int value = 0;
Expand All @@ -19,7 +19,7 @@ int main(void) {
" from_chars_int_supported)

# Check for double support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
double value = 0;
Expand All @@ -30,7 +30,7 @@ int main(void) {
" from_chars_double_supported)

# Check for long double support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
long double value = 0;
Expand Down
8 changes: 4 additions & 4 deletions cmake/to_chars_tests.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Test for std::to_chars.
# The floating point versions are specified in C++17, but compiler support varies.
include(CheckSourceCompiles)
include(CheckCXXSourceCompiles)

# CMP0067: Honor language standard in try_compile() source-file signature.
# https://cmake.org/cmake/help/latest/policy/CMP0067.html
cmake_policy(SET CMP0067 NEW)
set(CMAKE_CXX_STANDARD 17)

# Check for int support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
int value = 0;
Expand All @@ -19,7 +19,7 @@ int main(void) {
" to_chars_int_supported)

# Check for double support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
double value = 0;
Expand All @@ -30,7 +30,7 @@ int main(void) {
" to_chars_double_supported)

# Check for long double support
check_source_compiles(CXX "
check_cxx_source_compiles("
#include <charconv>
int main(void) {
long double value = 0;
Expand Down

0 comments on commit 1ecd001

Please sign in to comment.