chore: remove leftover CMake checks for std::string_view Fixes #1669 This removes the final vestige of the JSONCPP_HAS_STRING_VIEW build system logic. As of the previous commit (inlining std::string_view methods into value.h to fix ABI breaks), the library no longer relies on the build system (CMake or Meson) to check for and define JSONCPP_HAS_STRING_VIEW. The header value.h automatically activates std::string_view overloads purely by checking the consumer`s __cplusplus >= 201703L. Since none of the actual std::string_view symbols are compiled into the .so / .a library anymore, Meson (and CMake) builds are identical regardless of whether string_view is supported by the compiler building the library.
diff --git a/src/lib_json/CMakeLists.txt b/src/lib_json/CMakeLists.txt index a0695e9..dd73af3 100644 --- a/src/lib_json/CMakeLists.txt +++ b/src/lib_json/CMakeLists.txt
@@ -7,7 +7,6 @@ include(CheckTypeSize) include(CheckStructHasMember) include(CheckCXXSymbolExists) -include(CheckCXXSourceCompiles) check_include_file_cxx(clocale HAVE_CLOCALE) check_cxx_symbol_exists(localeconv clocale HAVE_LOCALECONV) @@ -26,10 +25,7 @@ endif() endif() -check_cxx_source_compiles( - "#include <string_view> - int main() { std::string_view sv; return 0; }" - JSONCPP_HAS_STRING_VIEW) + set(JSONCPP_INCLUDE_DIR ../../include)
diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index a8eb72d..5b4df37 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp
@@ -17,9 +17,7 @@ #include <sstream> #include <utility> -#ifdef JSONCPP_HAS_STRING_VIEW -#include <string_view> -#endif + // Provide implementation equivalent of std::snprintf for older _MSC compilers #if defined(_MSC_VER) && _MSC_VER < 1900