Comments (4)
You should be able to use the --ignore flag to exclude a tree of files from the analysis. This is typically for build folders, but may be of use in this case too.
I do wonder why it should not be ambiguous? If an include you do have cannot decide between a local include and an imported one, that is still actually ambiguous.
from cpp-dependencies.
Thanks, I'll give that a go. Sounds like a useable workaround.
However, I don't think there's any ambiguity.
#include <catch.hpp>
will only possibly find one header file which is on the include path.
The include path is set to ./externals/catch/include
I'm not sure why cpp-dependencies thinks this is ambiguous.
./externals/catch/include/catch.hpp
./externals/catch/single_include/catch.hpp
are the options it puts forward but the second path is not on any include path (the project I referenced has only one source file).
I'm keen to start using cpp-dependencies as part of our build toolset. Do let me know if I can provide any more useful information.
from cpp-dependencies.
It finds it ambiguous because you include "catch.hpp" which could be either of those. And it's correct at that - it could be either. Changing your include paths or reordering dependencies could have the result of including the other header with the resulting hidden change in behavior. In this particular case one of them is generated from the other, but in other cases they may be subtly incompatible and result in very hard to find bugs, or cause build instability when adding correct dependencies.
The tool is meant for large code bases, so the issues it finds may seem silly in a small example. Imagine having 100.000 files and unqualified include statements like this that may find one out of three headers depending on where you include it. Suddenly it's very important to have unique includes - not necessarily unique file names, but include statements that can only go to one header.
A concrete way of fixing / avoiding this is to ignore one of the two paths, to get one of the two to change his name, or to include it such that it's obvious which one you include. For example, `#include "single_include/catch.hpp" would not be ambiguous. Given the size of your problem I wouldn't mind it too much.
from cpp-dependencies.
Thanks, that's clear and unambiguous.
We've started using this tool on a much larger code base and already find it very useful.
from cpp-dependencies.
Related Issues (20)
- Make includesize output more useful by outputting the highest scores only
- Create clang-format file & run it in CI system somewhere
- dose this also work for C only? HOT 1
- boost dependency necessary for Linux? HOT 2
- Make very explicit what the tool does with CMakeLists HOT 3
- No such file or directory error HOT 2
- Release pre-built binaries for Linux/MacOS/Windows HOT 1
- Error when compiling with VS on Windows - memrchr HOT 5
- Add support for d3.js visualisations HOT 1
- std::bad_alloc (core dumped) on Ubuntu 16.04
- Does it support bazel build system ? HOT 1
- show snap installation instructions on readme? HOT 2
- C++17 std::filesystem instead of boost HOT 4
- Assertion failed in src/Input.cpp:304 HOT 8
- Clarify purpose and status of this repository HOT 1
- Can I use cpp-dependencies to analyse C project? HOT 1
- Cannot scan libwebp due to parenthesis level check HOT 4
- Ubuntu 22.10 permission denied error with cpp-dependencies installed via snap
- assertion failed in ReadCmakelist while running cpp-dependencies on itself
- CMake Error about "Could NOT find Boost (missing: Boost_INCLUDE_DIR filesystem system)"
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 cpp-dependencies.