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

target_precompiled_header(Foo bar.h) creates both CMakeFiles/Foo.pch.dir/Bar.h.gch and CMakeFiles/Foo.dir/Bar.h.gch targets #14

Open
ANogin opened this issue Feb 20, 2018 · 5 comments

Comments

@ANogin
Copy link

ANogin commented Feb 20, 2018

I am trying to use this package under Ubuntu with gcc, and somehow I get the following:

  • The make rules for creating and using CMakeFiles/Foo.pch.dir/Bar.h.gch are done correctly - everything works
  • But there is also a make rule for creating CMakeFiles/Foo.dir/Bar.h.gch by compiling CMakeFiles/Foo.pch.dir/Bar.h (which fails as there is no such .h)... I could not figure out where it is coming from...
@nanoant
Copy link
Owner

nanoant commented Jul 26, 2018

Can you please provide me exact GCC and CMake version you are using. This issue may be specific to some recent CMake versions.

@m-7761
Copy link
Contributor

m-7761 commented Jul 27, 2018

Are you are including H files in your project? From my experience, this basically cannot work with this module (maybe a note should be added to the README file.) The purpose of including H is to make the headers visible in project trees like Visual Studio's, however in general, CMake doesn't do anything else with them.

CMake conflates the H files with a GCH/PCH's input. It's just a guess. (I really can't say what's happening here.) Unfortunately, you must choose between PCH benefits and seeing H files in your project editor.

@ANogin
Copy link
Author

ANogin commented Aug 6, 2018

I have seen this issue with cmake 2.8.12.2 and gcc 4.9.4 on Ubuntu 14.04.1, possibly in other configurations as well (this was obviuously a while ago).

@nanoant
Copy link
Owner

nanoant commented Apr 30, 2019

Please provide minimal CMakeLists.txt example with exact configuration, so I can try to replicate this in Docker for example.

@ANogin
Copy link
Author

ANogin commented Apr 30, 2019

I no longer have access to that example, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants