Skip to content

Commit 55ec3d0

Browse files
committed
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.
1 parent a7f60c7 commit 55ec3d0

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/lib_json/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ include(CheckIncludeFileCXX)
77
include(CheckTypeSize)
88
include(CheckStructHasMember)
99
include(CheckCXXSymbolExists)
10-
include(CheckCXXSourceCompiles)
1110

1211
check_include_file_cxx(clocale HAVE_CLOCALE)
1312
check_cxx_symbol_exists(localeconv clocale HAVE_LOCALECONV)
@@ -26,10 +25,7 @@ if(NOT (HAVE_CLOCALE AND HAVE_LCONV_SIZE AND HAVE_DECIMAL_POINT AND HAVE_LOCALEC
2625
endif()
2726
endif()
2827

29-
check_cxx_source_compiles(
30-
"#include <string_view>
31-
int main() { std::string_view sv; return 0; }"
32-
JSONCPP_HAS_STRING_VIEW)
28+
3329

3430
set(JSONCPP_INCLUDE_DIR ../../include)
3531

src/lib_json/json_value.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
#include <sstream>
1818
#include <utility>
1919

20-
#ifdef JSONCPP_HAS_STRING_VIEW
21-
#include <string_view>
22-
#endif
20+
2321

2422
// Provide implementation equivalent of std::snprintf for older _MSC compilers
2523
#if defined(_MSC_VER) && _MSC_VER < 1900

0 commit comments

Comments
 (0)