-
Notifications
You must be signed in to change notification settings - Fork 2
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
fmt v11 and c++20 modules support #10
Conversation
… to directly control modular build toggle.
…ule, to permit #include usage.
…ng handling of std module (build2 complains if building package with clang on Windows).
Notes and various issues encountered so far:
|
Re. 2 |
…the module fix PRs, but they're yet to make an upstream release.
Add gtest and gmock dependencies via build2 packages. Begun to map the logic from upstream CMake; added static library test-main and some initial tests to a basics subfolder.
…ath failures on CI.
Removed install module from fmt-tests bootstrap.build.
… rather than format_parse_context alias which is not exported by the fmt module.
Revert upstream to master branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, most of my comments are for clarifications
fmt-tests/basics/buildfile
Outdated
@@ -0,0 +1,45 @@ | |||
include ../test-main/ | |||
|
|||
#test_names = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these comments still useful?
fmt-tests/basics/buildfile
Outdated
# args-test \ | ||
# assert-test \ | ||
# base-test | ||
gtest_test_names = args-test assert-test base-test chrono-test color-test compile-fp-test compile-test format-test gtest-extra-test noexception-test os-test ostream-test printf-test std-test unicode-test xchar-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this list have been formed from globing the .cc
files? If not consider adding a comment about where to look to update this list (in upstream/tests/CMakeFiles.txt
)
fmt-tests/basics/buildfile
Outdated
# base-test | ||
gtest_test_names = args-test assert-test base-test chrono-test color-test compile-fp-test compile-test format-test gtest-extra-test noexception-test os-test ostream-test printf-test std-test unicode-test xchar-test | ||
|
||
# header-only-test <- header only mode seemingly not supported by this build2 package? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it was not supported, I basically had the same reasons as explained in the packaging guide although that wouldnt prevent support of header-only mode later if the demand is there. So far nobody needed it.
import libs += fmt%lib{fmt} | ||
import libs += gtest%lib{gtest} gmock%lib{gmock} | ||
|
||
liba{test-main}: test/cxx{test-main gtest-extra util} test/hxx{gtest-extra mock-allocator test-assert util} $libs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would defining it as libu
would have helped usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm yet to understand the intended usage of libu*
, despite having read through the docs information on them many times. When/why do you choose to use it?
I also found this: Note also that if you plan to link any of your unit tests in the whole archive mode, then you will also need to exclude the source file containing the primary executable's main() from the utility library
which suggests that if used here then test-main
library could not contain text-main.cc
. Having said that, the test-main
library target is essentially reflecting upstream CMake and it's arguably not even worth having?
fmt/tests/basics/buildfile
Outdated
@@ -1,9 +1,13 @@ | |||
import! [metadata, rule_hint=cxx.link] libs = fmt%lib{fmt} | |||
|
|||
./ : exe{driver} : {cxx}{driver} hxx{tests.inl} $libs testscript{**} | |||
./ : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that line still necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently not ;)
I may have thought it more clear since the following two are both conditional, but indeed seems superfluous.
Updates to address issues in modules support provided by the build2 package. See issue #5.