Comments (10)
And I suppose we also need the
if()
because CMake might invoke the curl script twice and complain about an existing target on the second one?
-
I haven't encountered a situation where the same CMakeLists.txt is called twice yet
-
I still agree with what you said before, using a unique name may be the best solution
from curl.
Using unique (prefixed) target names seems to be best practise for libraries. Especially since FetchContent
exists, and people embed 3-party code in their build trees.
Dependencies brought in with FetchContent
are all mashed together with the main build.
from curl.
Does this patch fix this issue?:
https://github.com/curl/curl/commit/a4385903f364da4e55c3a7092ea9ac99e43cba4d.diff
(Via #13326)
from curl.
Does this patch fix this issue?: https://github.com/curl/curl/commit/a4385903f364da4e55c3a7092ea9ac99e43cba4d.diff
(Via #13326)
After verification, this patch has resolved this issue
from curl.
Thanks for testing and your feedback.
from curl.
Looks like target names share a common namespace in CMake. If so, an if()
would only hide the problem and break building curl manpages. Instead we should probably aim to use unique target names to avoid colliding with other projects.
(Renaming targets also rename the generated e.g. make
targets, with a slight chance of breaking builds downstream.)
Does that make sense?
from curl.
And I suppose we also need the if()
because CMake might invoke the curl script twice and complain about an existing target on the second one?
from curl.
And I suppose we also need the
if()
because CMake might invoke the curl script twice and complain about an existing target on the second one?
Using unique (prefixed) target names seems to be best practise for libraries. Especially since
FetchContent
exists, and people embed 3-party code in their build trees.Dependencies brought in with
FetchContent
are all mashed together with the main build.
If curl is included in other third-party libraries called in my project, and I also compile curl in my own code, then curl's CMakeLists.txt will be called multiple times. At this point, even if a unique name is used, an error may still occur: "See documentation for policy CMP0002 for more details.". Is there a win-win solution?
from curl.
I propose handling the self-duplicate issue separately as it's less clear-cut and also distinct from the namespace one.
I don't understand the details of that, which (or a sub-case of it?) also seems to be CMake version dependent based on past issues. Also we don't seem to have any protection for this, yet this hasn't come up in practice.
from curl.
I propose handling the self-duplicate issue separately as it's less clear-cut and also distinct from the namespace one.
I don't understand the details of that, which (or a sub-case of it?) also seems to be CMake version dependent based on past issues. Also we don't seem to have any protection for this, yet this hasn't come up in practice.
Okay, the issue of self repetition is currently only theoretical.
Thank you very much for fixing this issue.
from curl.
Related Issues (20)
- Please consider --ca-native for OpenSSL by default on Windows HOT 2
- version 8.7.0 and 8.7.1 don't compile against OpenSSL 1.1.0h on Linux HOT 3
- Change in behaviour for duplicate "Transfer-Encoding = chunked" headers HOT 3
- Please update tiny-curl HOT 1
- SOCKS problem with 8.7.0+ HOT 22
- test 345 fails on AppVeyor HOT 2
- Unable to upload file with curl when --limit-rate is set to specific value HOT 3
- GitHub actions major outage/problem HOT 2
- `git clone` hangs with curl-8.7.1 HOT 7
- wolfSSL HTTP/3 peer verification is lacking HOT 5
- Ambiguous error message when decompressing brotli stream HOT 2
- CURL_VERSION_GSSAPI is not display on curl tool. HOT 4
- Bug in Debian (curl-8.7.1) leads to Failed writing received data to disk/application HOT 10
- Error 451 when transfering certain files using FTPS\TLS1.3 HOT 3
- Fail during configure if perl is missing but required HOT 5
- Windows DNS resolution: Curl crash when GetAddrInfoExW callback invoked on shutdown HOT 7
- CURLOPT_SSLVERSION: C++20 deprecation warning when values of two enums are combined HOT 1
- Sign the un-preprocessed `git archive` .tar.gz
- CMake: Fail to looking for symbols in BoringSSL HOT 6
- Compiling "threaded-ssl.c" with PThreads4W
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 curl.