niosus/EasyClangComplete

Headers from listed add_definitions are not getting included and pch breaks completion

dortamiguel opened this issue · 1 comments

Fill the gaps below this line and remove all text above it


System info:

  • Sublime Text version: Sublime Text 4 (Build 4107)
  • Which system are you on: macos catalina
  • Clang version: Apple clang version 11.0.3 (clang-1103.0.32.62)

What happens:

On my cmake I have a global hpp include like this

add_definitions(-include global.hpp)

This global.hpp has #include <string> and clang compiles fine files that are using std::string whitout being explicit about this include.

I know this is not a good practice but the plan is to setup a pch, for the moment, there is any way of forcing a global include on EasyClangComplete?

image

Also it seems like the plugin stops working when adding a pch in the CMakeLists.txt with target_precompile_headers, I get the following message in the console when using this

[ECC:ERROR  ]: error while compiling: Error parsing translation unit.
[ECC:CRITICAL]:  cannot create translation unit. Abort.

I realised you can use .clang_complete file in the root folder to add include folders