-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Windows can't detect the include folder from the CMakeLists.txt file #758
Comments
Ok, the only weird thing I see is this:
which points me to this: is there something different in how CMake generates a compilation database on Windows as opposed to Linux or mac? Could you also provide a compilation database file that gets generated as the result?
|
Uhm it could be, I found some small differences between clang from apple and clang from mingw. I attached here the compile_commands.json file |
Sorry for the long silence. Looking at the compile commands file, I don't understand where the flags that start with |
Ok, after some googling, it seems it is a workaround on CMake side to avoid too many command flags on Windows. It packs them into the response files and then passes these files into the compilation. One solution, as seen in microsoft/vscode-cpptools#1718 (comment) is to parse that file and copy its contents as flags to the command that we construct within the plugin. It is not a trivial thing to do though, so it will take time. If you could maybe create a simple reproducer for me, i.e., a smallest possible project in which this happens along with all the plugin settings used and the setup that you use to build this project, this would help me immensely. As I'm not a Windows person, I'm a bit lost in the setup there. |
Sorry, I don't have a window machine anymore, I will in a couple of months |
Create minimal example if you can
CMakeLists.txt
like thisinclude_directories(SYSTEM "${CMAKE_SOURCE_DIR}/include")
System info:
What happens:
So detecting headers from
CMakeLists.txt
withinclude_directories
will not work on Windows. The program compiles fine in the terminal so it must be a configuration issue.In the end I made it work adding this to the plugin settings:
Though I mac I don't need to do this
The text was updated successfully, but these errors were encountered: