From b60faad5d73252cc18ec9b2798609e13017fb803 Mon Sep 17 00:00:00 2001 From: hsdk123 Date: Sun, 9 Jul 2023 19:54:21 -0400 Subject: [PATCH 1/4] add RAPIDCSV_WITH_CCACHE option --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3675fe..fdf6ec7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,13 @@ add_library(rapidcsv INTERFACE) target_include_directories(rapidcsv INTERFACE src) # Ccache -find_program(CCACHE_PROGRAM ccache) -if(CCACHE_PROGRAM) - message(STATUS "Found ccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") +option(RAPIDCSV_WITH_CCACHE "Use CCache if possible" ON) +if (RAPIDCSV_WITH_CCACHE) + find_program(CCACHE_PROGRAM ccache) + if(CCACHE_PROGRAM) + message(STATUS "Found ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + endif() endif() # Tests From 019b07e67b849fc47de3e0e626e7eac2a2615e0e Mon Sep 17 00:00:00 2001 From: Yoann Le Montagner Date: Tue, 11 Jul 2023 16:30:31 +0200 Subject: [PATCH 2/4] Fix build error with GCC 4.8.5 --- src/rapidcsv.h | 4 ++-- tests/test092.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rapidcsv.h b/src/rapidcsv.h index 1682310..0fcf6bb 100644 --- a/src/rapidcsv.h +++ b/src/rapidcsv.h @@ -148,13 +148,13 @@ namespace rapidcsv else if (typeid(T) == typeid(float)) { std::ostringstream out; - out << std::defaultfloat << std::setprecision(9) << pVal; + out << std::setprecision(9) << pVal; pStr = out.str(); } else if (typeid(T) == typeid(double)) { std::ostringstream out; - out << std::defaultfloat << std::setprecision(17) << pVal; + out << std::setprecision(17) << pVal; pStr = out.str(); } else diff --git a/tests/test092.cpp b/tests/test092.cpp index 0f7d1fe..14adcab 100644 --- a/tests/test092.cpp +++ b/tests/test092.cpp @@ -11,7 +11,7 @@ int main() std::string loc = "de_DE"; // uses comma (,) as decimal separator try { - std::locale::global(std::locale(loc)); + std::locale::global(std::locale(loc.c_str())); } catch (const std::exception& ex) { From a8ee8444c83c355ee1bef25e6bf1a79f1dcb3785 Mon Sep 17 00:00:00 2001 From: Kristofer Berggren Date: Sun, 30 Jul 2023 12:54:50 +0800 Subject: [PATCH 3/4] enable ccache only when tests are enabled, bump version --- CMakeLists.txt | 17 +++++++---------- src/rapidcsv.h | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdf6ec7..2b6c73e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,16 +32,6 @@ endif() add_library(rapidcsv INTERFACE) target_include_directories(rapidcsv INTERFACE src) -# Ccache -option(RAPIDCSV_WITH_CCACHE "Use CCache if possible" ON) -if (RAPIDCSV_WITH_CCACHE) - find_program(CCACHE_PROGRAM ccache) - if(CCACHE_PROGRAM) - message(STATUS "Found ccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") - endif() -endif() - # Tests option(RAPIDCSV_BUILD_TESTS "Build tests" OFF) message(STATUS "Build tests: ${RAPIDCSV_BUILD_TESTS}") @@ -51,6 +41,13 @@ if(RAPIDCSV_BUILD_TESTS) include(CTest) enable_testing() + # Ccache + find_program(CCACHE_PROGRAM ccache) + if(CCACHE_PROGRAM) + message(STATUS "Found ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") + endif() + # Enable codecvt tests if supported if (CMAKE_CXX_STANDARD VERSION_LESS "17") include(CheckIncludeFileCXX) diff --git a/src/rapidcsv.h b/src/rapidcsv.h index 1682310..540dc32 100644 --- a/src/rapidcsv.h +++ b/src/rapidcsv.h @@ -2,7 +2,7 @@ * rapidcsv.h * * URL: https://github.com/d99kris/rapidcsv - * Version: 8.78 + * Version: 8.79 * * Copyright (C) 2017-2023 Kristofer Berggren * All rights reserved. From 23f370c31a109c9583f4e4d41239d5ad4d5bb6c7 Mon Sep 17 00:00:00 2001 From: Kristofer Berggren Date: Sun, 30 Jul 2023 13:39:38 +0800 Subject: [PATCH 4/4] follow up to 019b07e - bump version --- src/rapidcsv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rapidcsv.h b/src/rapidcsv.h index ec9de6c..cc603af 100644 --- a/src/rapidcsv.h +++ b/src/rapidcsv.h @@ -2,7 +2,7 @@ * rapidcsv.h * * URL: https://github.com/d99kris/rapidcsv - * Version: 8.79 + * Version: 8.80 * * Copyright (C) 2017-2023 Kristofer Berggren * All rights reserved.