Skip to content

PCHs in subdirectories doesn't work without FORCEINCLUDE #18

Description

@dutow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions