Skip to content
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

Require Pass -iframework Options to C/C++ Extension #1178

Closed
julee opened this issue Apr 16, 2020 · 5 comments
Closed

Require Pass -iframework Options to C/C++ Extension #1178

julee opened this issue Apr 16, 2020 · 5 comments
Assignees
Labels
Milestone

Comments

@julee
Copy link

julee commented Apr 16, 2020

See this issue:
microsoft/vscode-cpptools#3323 (comment)

macOS needs iframework option to help head files search, but with "configurationProvider": "vector-of-bool.cmake-tools" ,cmake tool doesn't pass this option.

I can only remove "configurationProvider": "vector-of-bool.cmake-tools", and add "compileCommands": "${workspaceFolder}/build/compile_commands.json" to work around.

@JSchneidler
Copy link

What are the implications of the workaround (using compileCommands instead of configurationProvider)? Does this affect the extension's functionality at all?

@andreeis
Copy link
Contributor

andreeis commented Feb 26, 2021

CMake Tools functionality is not affected at all, you can use this extension the same. What will be different is that with compile_commands.json, depending on the C/C++ source code complexity and the operations you are running on what symbols, IntelliSense may work less accurate than when configurationProvider is used, because the last one is designed to store more information that CppTools can use. But depending the source code and operations performed on it, they may both work the same.

Another advantage for using configurationProvider is that it updates automatically when you change any CMake configure parameters (kit, variant, etc...). With compile_commands.json, you have to make sure you have an up-to-date one. Various settings or events may inhibit the creation of compile_commands. But you seem pretty experienced with it so I think you'll know how to ensure that compile_commands.json is used properly here.

I think this workaround should be good enough for now. Let us know if you experience any other inconveniences because of this.

@bobbrow bobbrow added this to Triage in 1.7.0 Mar 1, 2021
@andreeis andreeis assigned andreeis and unassigned elahehrashedi Mar 2, 2021
@andreeis andreeis modified the milestones: 1.7.0, 1.8.0 Mar 26, 2021
@andreeis andreeis removed this from Triage in 1.7.0 Mar 26, 2021
@andreeis andreeis added this to Triage in 1.8.0 Mar 29, 2021
@ABBAPOH
Copy link

ABBAPOH commented Jun 14, 2021

I encountered the same issue. The workaround works except for the other problem - I had to set "cppStandard": "c++17" in c_cpp_properties.json despite the fact the "-std=c++17" flag is present in "compile_commands.json". Without the flag all Qt headers are parsed incorrectly.
It would be really great if cmake-tools support frameworks on Mac correctly.
Thanks in advance!

@bobbrow bobbrow modified the milestones: 1.8.0, 1.9.0 Aug 17, 2021
@bobbrow bobbrow removed this from the 1.9.0 milestone Oct 19, 2021
@bobbrow bobbrow added this to the On Deck milestone Oct 19, 2021
@ggreco
Copy link

ggreco commented Mar 27, 2023

... still not working in 2023, the compile_commands workaround works, but it's something that cannot really be pushed to a repo (changing the build directory for instance will break it and it does not work with cppStandard and other cmake set variables)...

@bobbrow
Copy link
Member

bobbrow commented Mar 27, 2023

CMake doesn't provide us the information we need to make it work. There's an issue open that you can go upvote. https://gitlab.kitware.com/cmake/cmake/-/issues/19897.

I'm going to close this as a duplicate of #2324 where this was also discussed.

@bobbrow bobbrow closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants