Comments (13)
Fine, I like this: https://github.com/approvals/ApprovalTests.cpp/blob/master/CMake/WarningsAsErrors.cmake
from ut.
That is caused by my changes, I have noted to it during review!
the project name was changed to ut
.
the imported target to Boost::ut
see
Line 134 in 1cc75c2
from ut.
That is caused by my changes, I have noted to it during review!
the project name was changed to
ut
.
the imported target toBoost::ut
see
Line 134 in 1cc75c2
Thanks for the reply.
There's nearly 500 stars and more than 40 forks of this project, so that's a lot of people, many of whom have to update their builds.
And those of us that maintain libraries that provide interfaces to this project now have to decide whether to drop supporting the older versions, or not support newer versions....
Please consider maintaining aliases for backwards compatibility, to prevent this breaking change.
from ut.
And those of us that maintain libraries that provide interfaces to this project now have to decide whether to drop supporting the older versions, or not support newer versions....
Please consider maintaining aliases for backwards compatibility, to prevent this breaking change.
one problem was: the config version.cmake
file were not installed.
so the find-package(...)
does not realy work!
and other Boost
components are all exported as i.e. Boost::filesystem
Is it possible to do add_library(boost.ut ALIAS Boost::ut)
after FetchContent_MakeAvailable
()?
from ut.
and other
Boost
components are all exported as i.e.Boost::filesystem
That's a really interesting point...
I really agree with the name chosen for this project in Conan-center-index, which is boost-ext-ut - the reason I agree is that this project isn't part of boost, and calling its target Boost.ut creates a cause for confusion, I feel... The name boost-ext-ut feels fairer - suggesting external.
https://github.com/conan-io/conan-center-index/tree/master/recipes/boost-ext-ut
Is it possible to do
add_library(boost.ut ALIAS Boost::ut)
afterFetchContent_MakeAvailable
()?
I think it's not that simple... it would have to be something like this pseudo-code:
if target Boost::ut exists
add_library(boost.ut ALIAS Boost::ut)
endif
Why impose that on users, and more importantly, the time taken to research the problem when they get the failure, as happened to me today - when it could be a one-liner inside the project?
from ut.
you should be happy, it works now without your config hacks:
bash-3.2$ git diff
diff --git a/dev_approvals_fetch_content/CMakeLists.txt b/dev_approvals_fetch_content/CMakeLists.txt
index 8e2eaa9..bf562b8 100644
--- a/dev_approvals_fetch_content/CMakeLists.txt
+++ b/dev_approvals_fetch_content/CMakeLists.txt
@@ -132,14 +132,16 @@ FetchContent_Declare(boost.ut
GIT_TAG ${UtVersion})
FetchContent_MakeAvailable(boost.ut)
-if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
- # Turn off some checks off for boost.ut
- target_compile_options(boost.ut INTERFACE
- -Wno-c99-extensions # Needed for Boost.ut, at least in v1.1.6
- -Wno-documentation-unknown-command # unknown command tag name \userguide
- -Wno-weak-vtables
- -Wno-comma # See https://github.com/boost-ext/ut/issues/398
- )
+if(TARGET boost.ut)
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ # Turn off some checks off for boost.ut
+ target_compile_options(boost.ut INTERFACE
+ -Wno-c99-extensions # Needed for Boost.ut, at least in v1.1.6
+ -Wno-documentation-unknown-command # unknown command tag name \userguide
+ -Wno-weak-vtables
+ -Wno-comma # See https://github.com/boost-ext/ut/issues/398
+ )
+ endif()
endif()
# -------------------------------------------------------------------
bash-3.2$
from ut.
@claremacrae one note: IMHO the fetchcontents
is very slow and not very flexible to use.
would it be an option to try https://github.com/cpm-cmake/CPM.cmake
with local cache enable
, it is really fast!
from ut.
you should be happy, it works now without your config hacks:
....
Thanks - I appreciate the suggestion....
One of the benefits of the ApprovalTests.cpp.CMakeSamples project is for me to test out code against multiple different versions of Boost.ut, when we get bug reports from ApprovalTests users, such as approvals/ApprovalTests.cpp#157
Hence my desire to be able to keep building against a variety of Boost.ut versions...
from ut.
@claremacrae one note: IMHO the
fetchcontents
is very slow and not very flexible to use.would it be an option to try https://github.com/cpm-cmake/CPM.cmake
with
local cache enable
, it is really fast!
Thanks for that suggestion too...
Another of the benefits - in fact purposes - of ApprovalTests.cpp.CMakeSamples is to provide tested CMake code that we can embed in to the ApprovalTests.cpp docs, at these two pages:
- https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/CMakeIntegration.md
- https://github.com/approvals/ApprovalTests.cpp/blob/master/doc/ConanIntegration.md
What I'm after is simple, standard things that work with CMake out of the box - and Conan out of the box - so that I can give new users at least one simple thing to try for them...
So there's no advantage to me in having a layer on top to speed things up, as it one more thing to document and test....
For that kind of documentation - and the target audience of people getting started - simpler is better...
Anyone who already knows about CPM or similar is of course free to disregard the pointers we give, and make their own way...
from ut.
Is it possible to do
add_library(boost.ut ALIAS Boost::ut)
afterFetchContent_MakeAvailable
()?
Just to help anyone else who comes here, the above gives an error about Boost::ut already being an alias.
This works:
add_library(boost.ut ALIAS ut)
from ut.
@claremacrae would the following be okay?
from ut.
@claremacrae would the following be okay?
Thanks! I've answered in that ticket...
I worked around the issue before you kindly added that, but I think it's likely that the change will affect others as well.
Also for others here, the suggestion in #430 (comment) didn't work for me with clang9, with the latest boost.ut. I still got lots of warnings about C99 code...
This is what I needed, to work with Clang 9 on Linux:
message(NOTICE "Fetching boost.ut...")
set(BUILD_BENCHMARKS OFF CACHE BOOL "")
set(BUILD_EXAMPLES OFF CACHE BOOL "")
set(BUILD_TESTS OFF CACHE BOOL "")
FetchContent_Declare(boost.ut
GIT_REPOSITORY https://github.com/boost-ext/ut.git
GIT_TAG ${UtVersion})
FetchContent_MakeAvailable(boost.ut)
if(TARGET Boost::ut)
add_library(boost.ut ALIAS ut)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# Turn off some checks off for boost.ut
target_compile_options(ut INTERFACE
-Wno-c99-extensions # Needed for Boost.ut, at least in v1.1.6
-Wno-documentation-unknown-command # unknown command tag name \userguide
-Wno-weak-vtables
-Wno-comma # See https://github.com/boost-ext/ut/issues/398
)
endif()
from ut.
Closing, since based on the comments, it seems unlikely that it's worth leaving open...
I've added notes above, in the hope of helping others out....
from ut.
Related Issues (20)
- running clang-format on ut.hpp in master produces changes?
- 7 tests fail
- Would be nice if the _i operator accepted hex constants HOT 1
- Boost review process
- `using namespace boost::ut;` breaks piping views that are copied to local variable.
- Test crashes in aarch64 built with clang++ HOT 1
- clang-scan-deps fails on ut.hpp
- Tests fail due to global instances destroyed HOT 1
- Leak when a source file starts with an A
- std::cout blocked from printing, is there an option to set?
- Version 2.0.1 segfaults when using std::format and std::cout on multiple threads HOT 24
- aborts support on Windows?
- Tests are always skipped when ut is #included into a module
- Number of asserts is reported wrongly HOT 1
- Fatal expression with custom message compile error HOT 2
- Custom message for fatal expressions not shown
- Add the option to display a diff when comparing strings
- Unnecessary CPM.cmake to Get PackageProject.cmake
- Disable Install Targets If It Is a Subproject HOT 1
- SEGV when using Clang [12, 16] HOT 12
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 ut.