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

PCHs in subdirectories doesn't work without FORCEINCLUDE #18

Open
dutow opened this issue Mar 16, 2018 · 0 comments
Open

PCHs in subdirectories doesn't work without FORCEINCLUDE #18

dutow opened this issue Mar 16, 2018 · 0 comments

Comments

@dutow
Copy link

dutow commented Mar 16, 2018

At least for GCC, without the FORCEINCLUDE option, the directory where the pch file is generated is added as an include path.

get_filename_component(_name ${_input} NAME)
// ...
set(_pchfile "${_pch_binary_dir}/${_input}")
// ...
list(APPEND _pch_compile_flags -include "${_pchfile}")

This means that if the pch file is in a subdirectory (e.g. "foo/pch.h"), and that directory itself isn't in the include path, the compiler won't be able to find the gch file, and the original header will be used instead.

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

No branches or pull requests

1 participant