Comments (8)
Let me try that! Will report back
from pegtl.
Hi, sorry for the wait, we had to ponder a couple of possibilities, especially since the drive towards a PEGTL 4.0.0 is also driving us towards cleaning out support for older compilers and non-standard libraries.
If you can prepare and test a PR that adds support for this additional filesystem library to the PEGTL 3.x branch we would merge the PR, tag a new PEGTL 3.x version, update the PEGTL in taoJSON to that new version, and tag a new taoJSON beta release.
That still gives us the possibility to go the other way in the PEGTL development branch, e.g. remove support for std::experimental::filesystem
and boost::filesystem
from the PEGTL 4.0 to end up with only std::filesystem
.
This will eventually be used in taoJSON, too, but you can use the taoJSON version with the new 3.x PEGTL for as long as you need.
Does this work for you?
from pegtl.
That works for me thank you! Let me get to it next few weeks.
Iām also happy to maintain a branch and realize audio is probably unique in this osx regard
another option I considered: why does taojson even have a file system dependency? I am using it entirely for in memory communication and not for any file handling. I wonder if a build of the suite with zero file system support as an option may be a more tolerable approach for your forward plans? Happy to consider that also
Thanks for these super libraries also
from pegtl.
In that case, have you tried selectively including only the parts of taoJSON that you need, rather than tao/json.hpp
which pulls in everything but the kitchen sink? That way it should be possible to completely omit the file handling parts.
from pegtl.
OK this strategy works remarkably well with one and only one change required.
Your CMakeList in pegtl assumes you are using a filesystem implementation. That is, it checks std::fs then std::exp::fs then boost and if none of those work, it fails cmake.
I made the following change to your CMakeLists
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2ee336f..b3eaee82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,7 +82,9 @@ function(check_filesystem_impl FILESYSTEM_HEADER FILESYSTEM_NAMESPACE OPTIONAL_L
set(${OUT_RESULT} ${TEST_RESULT} PARENT_SCOPE)
endfunction()
-if(PEGTL_USE_BOOST_FILESYSTEM)
+if (PEGTL_NO_STD_FILESYSTEM)
+ target_compile_definitions(${PROJECT_NAME} INTERFACE TAO_PEGTL_NO_STD_FILESYSTEM)
+elseif (PEGTL_USE_BOOST_FILESYSTEM)
# Force the use of Boost.Filesystem: #include <boost/filesystem.hpp> // boost::filesystem
find_package(Boost REQUIRED COMPONENTS filesystem)
target_link_libraries(${PROJECT_NAME} INTERFACE Boost::filesystem)
and then cache set PEGTL_NO_STD_FILESYSTEM and was able to do a 10.13 build. (There's other 10.13 C++17 APIs which will then stop me going back to 10.9 but really 10.14 is the target I'm aiming for).
Would you consider merging such a change? I don't want to maintain a fork for just this, but I also don't want to install boost just so I can not use it and have cmake work :) Oh and presumably you would add an option
above (I was sloppy). I can prep that as a PR if you like also.
from pegtl.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c2ee336f..718b69ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,7 @@ target_include_directories(pegtl INTERFACE
target_compile_features(pegtl INTERFACE cxx_std_17)
option(PEGTL_USE_BOOST_FILESYSTEM "Override the auto-detection of std::filesystem and use Boost.Filesystem" OFF)
+option(PEGTL_NO_STD_FILESYSTEM "Don't link to any std::filesystem; file operations will not work" OFF)
# Try compiling a test program with std::filesystem or one of its alternatives
function(check_filesystem_impl FILESYSTEM_HEADER FILESYSTEM_NAMESPACE OPTIONAL_LIBS OUT_RESULT)
@@ -82,7 +83,10 @@ function(check_filesystem_impl FILESYSTEM_HEADER FILESYSTEM_NAMESPACE OPTIONAL_L
set(${OUT_RESULT} ${TEST_RESULT} PARENT_SCOPE)
endfunction()
-if(PEGTL_USE_BOOST_FILESYSTEM)
+if (PEGTL_NO_STD_FILESYSTEM)
+ target_compile_definitions(${PROJECT_NAME} INTERFACE TAO_PEGTL_NO_STD_FILESYSTEM)
+ message(STATUS "Skipping std::filesystem in PEGTL; File operations will not work or compile.")
+elseif (PEGTL_USE_BOOST_FILESYSTEM)
# Force the use of Boost.Filesystem: #include <boost/filesystem.hpp> // boost::filesystem
find_package(Boost REQUIRED COMPONENTS filesystem)
target_link_libraries(${PROJECT_NAME} INTERFACE Boost::filesystem)
there's the complete diff I ended up using with a message and also with an option.
Look forward to your feedback! Thanks so much.
from pegtl.
If you like this approach and it makes your life easier, I submitted the diff as #350 but feel free to close or ignore that of course! Thanks
from pegtl.
Continued in #350.
from pegtl.
Related Issues (20)
- static_assert and two phase name lookup in demangle HOT 4
- [Git main] Merge conflict markers in file "doc/Changelog.md" HOT 2
- [>=3.2.1] Compile error with GCC 9.2 ā error: must '#include <typeinfo>' before using 'typeid' HOT 6
- How do I capture each substring at run time HOT 3
- MSVC: error C2338: static_assert failed: 'internal::dependent_true< T > && ( begin != std::string_view::npos ) HOT 3
- Example grammar proto3 does not accept enum fields starting from zero HOT 2
- data type of input? byte? character? HOT 3
- <ciso646> is removed in C++20 and should not be included HOT 1
- Feature Request: Add defines to exclude headers to improve compile time HOT 4
- parse_tree needs to be optimized HOT 8
- Does "pegtl" support the operation of binary data serialization/deserialization? HOT 2
- Why parsing succeeds? HOT 3
- Why do I have an infinite loop? HOT 4
- parser_tree.cpp example not compiling in VS 2022, as of PEGTL 3.2.6 HOT 4
- Order independence of rules HOT 7
- list_tail<> invokes action for trailing separator twice? HOT 10
- Parsing Binary Data Encounters Left recursion Problem HOT 9
- Can't get custom error messages to work. HOT 8
- Backreferences and grammar tracing/analyzing. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pegtl.