-
Notifications
You must be signed in to change notification settings - Fork 25
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
CMake Compilation DB remains empty when cross compiling using a toolchain file #181
Comments
The "C/C++ General / Preprocessor Include Paths / Entries / CMake Compilation DB" tab is not always immediately updated by CDT. To see the exact settings,
You can find the exact include search path in the log file. |
Attached you find the parser logs for both the native and cross compilation case. The latter shows no trace of any compiler built in include path or define. There's no hint why it fails. BTW cross build works fine, i.e. the cross compiler is found along the path and is working ok. parser-native-gcc.log Following the discussion of the issues you linked, I guess its a problem with the name of the compiler executable. Here's the relevant portion from compile-commands.json:
CMake is using the 8.3 file name for the compiler executable. Since short file names are more or less random, no regex will help here, hence the option parser can't recognize it as a gcc variant. See also #31, which narrows the problem down CMake using 8.3 filenames if the path to compiler paths contains spaces. Thanks @nolange, you made my day :-) Solution Suggestions for improvement |
The fix for #31 has already been ported to CDT. The code is in expandShortFileName(). No idea, why the fix does not work. I could never really test it since I am on Linux. Note that the method comment mentions a bug in cmake that is still unresolved.
This would require changes in CDT. You may want to file a bug there.
Guessing is already implemented. Probing (by running the compiler with options that make it spit out its version info) would be really hard: Options differ per compiler; version output differs, too. |
Thanks for the pointer, I'll take a look at it when I find the time. |
Describe the bug
When using a cmake toolchain file for cross compilation, the CMake Compilation DB remains empty. The compiler defined include paths, compiler set #defines and defines set in CMakeLists.txt are not propagated to the Eclipse indexer.
To Reproduce
Steps to reproduce the behavior:
A small project demonstrating the problem is attached. It contains two build configurations:
Expected behavior
CMake Compilation DB propagated not empty when cross compiling
Further observations
Useful Information
test.zip
The text was updated successfully, but these errors were encountered: