Trying again.

This commit is contained in:
Daniel Lemire 2021-01-27 21:01:47 -05:00
parent 00591a8652
commit 36afa46f1e
5 changed files with 16 additions and 12 deletions

View File

@ -9,6 +9,7 @@ jobs:
fail-fast: false
matrix:
include:
# Legacy/x86 compilers cause CI failures.
#- {cxx: -DCMAKE_CXX_COMPILER=g++-5, arch: }
#- {cxx: -DCMAKE_CXX_COMPILER=g++-6, arch: }
- {cxx: , arch: } # default=gcc7

View File

@ -9,6 +9,7 @@ jobs:
fail-fast: false
matrix:
include:
# Legacy/x86 compilers cause CI failures.
#- {cxx: -DCMAKE_CXX_COMPILER=g++-8, arch: }
- {cxx: , arch: } # default=gcc9
#- {cxx: , arch: -DCMAKE_CXX_FLAGS="-m32"} # default=gcc9

View File

@ -1,10 +1,17 @@
cmake_minimum_required(VERSION 3.9)
project(fast_float VERSION 0.7.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
if(FASTFLOAT_TEST)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED OFF)
enable_testing()
add_subdirectory(tests)
else(FASTFLOAT_TEST)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "Tests are disabled. Set FASTFLOAT_TEST to ON to run tests.")
endif(FASTFLOAT_TEST)
option(FASTFLOAT_SANITIZE "Sanitize addresses" OFF)
@ -28,9 +35,4 @@ if(FASTFLOAT_SANITIZE)
endif()
endif()
if(FASTFLOAT_TEST)
enable_testing()
add_subdirectory(tests)
else(FASTFLOAT_TEST)
message(STATUS "Tests are disabled. Set FASTFLOAT_TEST to ON to run tests.")
endif(FASTFLOAT_TEST)

View File

@ -38,7 +38,6 @@ function(fast_float_add_cpp_test TEST_NAME)
target_compile_options(${TEST_NAME} PUBLIC -Wsign-compare -Wshadow -Wwrite-strings -Wpointer-arith -Winit-self -Wconversion -Wsign-conversion)
endif()
target_link_libraries(${TEST_NAME} PUBLIC fast_float doctest supplemental-data)
target_compile_features(${TEST_NAME} PUBLIC cxx_std_11)
endfunction(fast_float_add_cpp_test)

View File

@ -26,19 +26,21 @@
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(sun) || defined(__sun)
#define FASTFLOAT_ODDPLATFORM 1
#endif
#if defined __has_include
#if __has_include (<filesystem>)
#else
// filesystem is not available
#define FASTFLOAT_ODDPLATFORM 1
#endif
#else
// __has_include is not available
#define FASTFLOAT_ODDPLATFORM 1
#endif
// C++ 17 because it is otherwise annoying to browse all files in a directory.
// We also only run these tests on little endian systems.
#if (FASTFLOAT_CPLUSPLUS >= 201703L) && (FASTFLOAT_IS_BIG_ENDIAN == 0) && !defined(FASTFLOAT_ODDPLATFORM)
#include <iostream>
#include <filesystem>
#include <charconv>
@ -105,7 +107,6 @@ TEST_CASE("supplemental") {
CHECK(check_file(entry.path().string()));
}
}
#endif