diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-01-25 14:03:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-01-28 13:41:28 (GMT) |
commit | f16dfdf71f8f81e1be9c3ea18652d8d87c1cb265 (patch) | |
tree | 7a8a17ef3ef7fd6b7adee89ae687d5f7412b0604 /Source/cmLocalGenerator.h | |
parent | 8e495333c0914a0684d6d82e2cc15327c9f811f3 (diff) | |
download | CMake-f16dfdf71f8f81e1be9c3ea18652d8d87c1cb265.zip CMake-f16dfdf71f8f81e1be9c3ea18652d8d87c1cb265.tar.gz CMake-f16dfdf71f8f81e1be9c3ea18652d8d87c1cb265.tar.bz2 |
cmLocalGenerator: Simplify `GetIncludeDirectories`
This patch strips the `stripImplicitDirs` and `appendAllImplicitDirs`
parameters from the `cmLocalGenerator::GetIncludeDirectories` method and makes
it a wrapper into the new `cmLocalGenerator::GetIncludeDirectoriesImplicit`
method. `cmLocalGenerator::GetIncludeDirectoriesImplicit` is the renamed old
implementation of `cmLocalGenerator::GetIncludeDirectories` and still
accepts `stripImplicitDirs` and `appendAllImplicitDirs`.
The motivation is that there's only *one* case where
`cmLocalGenerator::GetIncludeDirectories` is called with the
`stripImplicitDirs` parameter being `false` (QtAutoGen), but many other places
where it is called using the `true` default value.
QtAutoGen is modified to use `cmLocalGenerator::GetIncludeDirectoriesImplicit`
directly. In two use cases of `cmLocalGenerator::GetIncludeDirectories`
the manually set `true` value for `stripImplicitDirs` is removed.
Diffstat (limited to 'Source/cmLocalGenerator.h')
-rw-r--r-- | Source/cmLocalGenerator.h | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index ebc613b..7cc7e37 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -239,22 +239,46 @@ public: return true; } - /** @brief Get the include directories for the current makefile and language. + /** @brief Get the include directories for the current makefile and language + * and optional the compiler implicit include directories. + * * @arg stripImplicitDirs Strip all directories found in * CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES from the result. * @arg appendAllImplicitDirs Append all directories found in * CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to the result. */ + std::vector<BT<std::string>> GetIncludeDirectoriesImplicit( + cmGeneratorTarget const* target, std::string const& lang = "C", + std::string const& config = "", bool stripImplicitDirs = true, + bool appendAllImplicitDirs = false) const; + + /** @brief Get the include directories for the current makefile and language + * and optional the compiler implicit include directories. + * + * @arg dirs Directories are appended to this list + */ + void GetIncludeDirectoriesImplicit(std::vector<std::string>& dirs, + cmGeneratorTarget const* target, + const std::string& lang = "C", + const std::string& config = "", + bool stripImplicitDirs = true, + bool appendAllImplicitDirs = false) const; + + /** @brief Get the include directories for the current makefile and language. + * @arg dirs Include directories are appended to this list + */ void GetIncludeDirectories(std::vector<std::string>& dirs, cmGeneratorTarget const* target, const std::string& lang = "C", - const std::string& config = "", - bool stripImplicitDirs = true, - bool appendAllImplicitDirs = false) const; + const std::string& config = "") const; + + /** @brief Get the include directories for the current makefile and language. + * @return The include directory list + */ std::vector<BT<std::string>> GetIncludeDirectories( cmGeneratorTarget const* target, std::string const& lang = "C", - std::string const& config = "", bool stripImplicitDirs = true, - bool appendAllImplicitDirs = false) const; + std::string const& config = "") const; + void AddCompileOptions(std::string& flags, cmGeneratorTarget* target, const std::string& lang, const std::string& config); |