-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make boost optional dependency #15
Comments
Yes, that's a good point. I agree both |
I've done this for Bazel in my fix-bazel-build branch, which adds rules for testing as well. However, the code may need some tweaking as well as I'm running into a few problems:
❯ bazel test ...
INFO: Build option --cxxopt has changed, discarding analysis cache.
INFO: Analyzed 14 targets (27 packages loaded, 4646 targets configured).
INFO: Found 4 targets and 10 test targets...
INFO: From Compiling test/into.cpp:
In file included from test/into.cpp:11:
In file included from ./zug/transducer/filter.hpp:12:
./zug/skip.hpp:16:9: warning: 'ZUG_VARIANT_BOOST' macro redefined [-Wmacro-redefined]
#define ZUG_VARIANT_BOOST 1
^
<command line>:4:9: note: previous definition is here
#define ZUG_VARIANT_BOOST 0
^
1 warning generated.
INFO: From Compiling test/into_vector.cpp:
In file included from test/into_vector.cpp:11:
In file included from ./zug/transducer/filter.hpp:12:
./zug/skip.hpp:16:9: warning: 'ZUG_VARIANT_BOOST' macro redefined [-Wmacro-redefined]
#define ZUG_VARIANT_BOOST 1
^
<command line>:4:9: note: previous definition is here
#define ZUG_VARIANT_BOOST 0
^
1 warning generated.
INFO: Elapsed time: 13.593s, Critical Path: 11.55s
INFO: 40 processes: 40 darwin-sandbox.
INFO: Build completed successfully, 51 total actions
//test:compose_test PASSED in 0.3s
//test:into_test PASSED in 0.2s
//test:into_vector_test PASSED in 0.2s
//test:meta_test PASSED in 0.2s
//test:reduce_test PASSED in 0.2s
//test:reductor_test PASSED in 0.2s
//test:run_test PASSED in 0.2s
//test:sequence_test PASSED in 0.2s
//test:state_traits_test PASSED in 0.1s
//test:transduce_test PASSED in 0.3s |
Some tests don't compile with GCC 10.0 on Linux without Boost, but do using clang 10.0.0 on Mac OS X 10.15.6. I'm wondering whether |
@yesudeep I think you have to remove the |
@arximboldi Agree. I've currently been trying to make the Bazel build work cross-platform while avoiding as many code changes as I can. I'm not sure but would you prefer to remove the dependency on Boost over the longer term? I've added an alias that maps the Also, would you be willing to accept PRs to add more comprehensive Bazel integration alongside CMake since you already have some support? It would make life easier for C++ programmers. The following is a lot easier than fighting with the build system/environment :) : cc_binary(
name = "myapp",
srcs = ["myapp.cpp"],
deps = [
"@zug", # Causes Bazel to fetch, include, compile, and link along with its dependencies.
],
) Do consider checking out this branch and taking it for a spin. Aside: You may also want to consider making C++ 17 the minimum requirement. People should be using it by now. Use --sandbox_debug to see verbose messages from the sandbox
test/reduce.cpp:39:16: error: constexpr variable cannot have non-literal type 'const (anonymous namespace)::(lambda at test/reduce.cpp:39:22)'
constexpr auto foo = [](auto step) {
^
test/reduce.cpp:39:22: note: lambda closure types are non-literal types before C++17
constexpr auto foo = [](auto step) {
^
1 error generated. |
Yes! I do believe that boost should be fully optional for this library, and better Bazel support would be highly appreciated. I am no Bazel expert though, but I'd be happy to review and integrate whatever you come up with.
Would rather not yet, sadly in commercial projects upgrading the stantard can often be very difficult, and the scope of this library is so limited that I see no reason to force it. |
I've taken a look into your other branch @yesudeep and it is looking good in general, but it seems to me that there are unnecessary changes. In particular, you changed all the includes from |
Hi @arximboldi I had originally used quotes instead of Do take this updated branch for a spin. |
So the solution is to have an |
I created PR #30 to solve the dependency in |
Steps to achieve it:
zug::sequence
. Could it be changed?ZUG_VARIANT_{STD,BOOST}
andZUG_ENABLE_BOOST
, add cmake option to switch variant implementation.The text was updated successfully, but these errors were encountered: