summaryrefslogtreecommitdiff
path: root/libcxx/CMakeLists.txt
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2022-11-18 15:01:33 -0500
committerLouis Dionne <ldionne.2@gmail.com>2022-11-20 10:51:32 -0500
commitaf8c49dc1ec44339d915d988ffe0f38da68ca0e7 (patch)
tree90e8c32329a297548c357932d0be69c70cd8fbe7 /libcxx/CMakeLists.txt
parent242a9cf7e6759bdd6c4af524d544f562b7385d27 (diff)
downloadllvm-af8c49dc1ec44339d915d988ffe0f38da68ca0e7.tar.gz
[libc++] Introduce a setting to remove fstream from the library
This allows porting the library to platforms that are able to support <iostream> but that do not have a notion of a filesystem, and where it hence doesn't make sense to support std::fstream (and never will). Also, remove reliance on <fstream> in various tests that didn't actually need it. Differential Revision: https://reviews.llvm.org/D138327
Diffstat (limited to 'libcxx/CMakeLists.txt')
-rw-r--r--libcxx/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index f08ca950735f..ba1651265ccf 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -84,6 +84,8 @@ option(LIBCXX_ENABLE_LOCALIZATION
the C locale API (e.g. embedded). When localization is not supported,
several parts of the library will be disabled: <iostream>, <regex>, <locale>
will be completely unusable, and other parts may be only partly available." ON)
+option(LIBCXX_ENABLE_FSTREAM
+ "Whether to include support for <fstream>." ON) # TODO: Consider rolling that into LIBCXX_ENABLE_FILESYSTEM
option(LIBCXX_ENABLE_UNICODE
"Whether to include support for Unicode in the library. Disabling Unicode can
be useful when porting to platforms that don't support UTF-8 encoding (e.g.
@@ -860,6 +862,7 @@ config_define_if(LIBCXX_ENABLE_PARALLEL_ALGORITHMS _LIBCPP_HAS_PARALLEL_ALGORITH
config_define_if_not(LIBCXX_ENABLE_FILESYSTEM _LIBCPP_HAS_NO_FILESYSTEM_LIBRARY)
config_define_if_not(LIBCXX_ENABLE_RANDOM_DEVICE _LIBCPP_HAS_NO_RANDOM_DEVICE)
config_define_if_not(LIBCXX_ENABLE_LOCALIZATION _LIBCPP_HAS_NO_LOCALIZATION)
+config_define_if_not(LIBCXX_ENABLE_FSTREAM _LIBCPP_HAS_NO_FSTREAM)
config_define_if_not(LIBCXX_ENABLE_UNICODE _LIBCPP_HAS_NO_UNICODE)
config_define_if_not(LIBCXX_ENABLE_WIDE_CHARACTERS _LIBCPP_HAS_NO_WIDE_CHARACTERS)
config_define_if_not(LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS)