Giter Club home page Giter Club logo

Comments (5)

ClausKlein avatar ClausKlein commented on May 31, 2024

see ClausKlein/ModernCmakeStarter@e57657f

from project_options.

aminya avatar aminya commented on May 31, 2024

Clang tidy returns the warnings from those headers if your config file includes all headers.

from project_options.

ClausKlein avatar ClausKlein commented on May 31, 2024

Yes, the only way I know to prevent this is to patch the CMake generated compile_commands.json file:

Claus-iMac:ModernCmakeStarter clausklein$ make -n check
perl -i.bak -p -e 's#-W[-\w]+(=\d)?\b##g;' -e 's#-I(/Users/clausklein/.cache/CPM)#-isystem $1#g;' ./build-ModernCmakeStarter-Debug/compile_commands.json
run-clang-tidy -p ./build-ModernCmakeStarter-Debug /Users/clausklein/Workspace/cpp/ModernCmakeStarter
Claus-iMac:ModernCmakeStarter clausklein$ 

from project_options.

aminya avatar aminya commented on May 31, 2024

What does this change?

from project_options.

ClausKlein avatar ClausKlein commented on May 31, 2024

What does this change?

I use CMP.cmake to fetch my dependencies. With perl script, I replace all -I include path to CMP cache to -isystem include path. And I delete all -W options because some gcc warnings are not valid vor clang.

When you use vpkg or conan the imported CMake config packages use implizit this -isystem include path.

Background info: I use the CPM_SOURCE_CACHE environment variable in my makefile!

perl -i.bak -p -e 's#-W[-\w]+(=\d)?\b##g;' -e 's#-I(${CPM_SOURCE_CACHE})#-isystem $$1#g;' $(BUILD_DIR)/compile_commands.json

from project_options.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.