1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 19:55:10 +08:00

69 Commits

Author SHA1 Message Date
Tushar Maheshwari
8cb3cffa42 cmSourceFile: Rename non-const GetLanguage
GetOrDetermineLanguage:
- Read the property if available
- Determine the Language using the file extension

Fix all usage of the non-const member in the repository.
2019-08-27 21:35:42 +05:30
Brad King
ddb1759b3e Merge topic 'cmStringAlgorithms_move_functions'
959b97a27f Tests: testStringAlgorithms: Add cmTrimWhitespace, cmEscapeQuotes, cmTokenize
7fbcc16dcd cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenize

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3647
2019-08-07 11:47:54 -04:00
Brad King
7eb2fd6ca6 Merge topic 'fileapi-install-generators'
d70a0f8681 fileapi: Fix codemodel target install destination for cross-dir rules

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3639
2019-08-05 10:20:27 -04:00
Sebastian Holtermann
7fbcc16dcd cmStringAlgorithms: cmIsSpace, cmTrimWhitespace, cmEscapeQuotes, cmTokenize
This adds the following functions to `cmStringAlgorithms`:

- `cmIsSpace`
- `cmTrimWhitespace` (moved from `cmSystemTools::TrimWhitespace`)
- `cmEscapeQuotes` (moved from `cmSystemTools::EscapeQuotes`)
- `cmTokenize` (moved from `cmSystemTools::tokenize` and adapted to
  accept `cm::string_view`)
2019-08-05 11:25:30 +02:00
Brad King
d70a0f8681 fileapi: Fix codemodel target install destination for cross-dir rules
Since commit e89ad0f94e (install: Allow installing targets created in
another directory, 2018-06-18, v3.13.0-rc1~407^2) we support calling
`install(TARGETS)` for targets created in another directory.  However,
install generators are associated with the directory in which the call
to `install()` appears.  This may not be the same directory in which the
target is defined.  Record in each target the list of install generators
it has.

Fixes: #19546
2019-07-31 19:32:55 -04:00
Brad King
b61fcdc8bc fileapi: Compute codemodel compile groups without target-wide settings
Previously we computed the entire description of each source file
including all target-wide settings, and then computed compile groups
using those complete descriptions.  This is inefficient when target-wide
settings are large because they are included in comparisons even though
they are the same for every source.  Instead compute source groups using
only the source-specific settings, and then merge the target-wide
settings into place only once per unique compile group.

This is a slight behavior change in the case that a source-specific
compile definition duplicates a target-wide definition.  Previously that
source would still be grouped with other sources which do not have the
definition because they would all get it from the target.  Now that
source will be in its own compile group even though it ultimately
compiles with the same settings as another group.  This is acceptable
because the source is specified by the project with source-specific
settings already.

Fixes: #19520
2019-07-30 10:03:35 -04:00
Brad King
e337e60a50 fileapi: Compute codemodel compile groups before converting to Json
Previously we converted the description of each source file into its
compile group Json object and then used the Json object itself as a
unique identifier for the group.  When source files have large
descriptions their Json objects make inefficient map keys requiring deep
comparison operations.  Instead use our internal `CompileData` structure
as a map key.  This enables use of a hash map.

Issue: #19520
2019-07-30 10:01:49 -04:00
Brad King
d89c0ecf79 fileapi: Generate codemodel Json backtraces earlier
Convert from `cmListFileBacktrace` to Json `backtraceGraph` entries
before storing in `CompileData`.  This will allow backtraces to be
uniquely identified, hashed, and compared as a single integer.
2019-07-30 10:01:36 -04:00
Brad King
833d9eae4e fileapi: Refactor codemodel defines de-duplication 2019-07-29 10:21:27 -04:00
Brad King
c9c397a14a fileapi: Avoid unnecessary CompileData move 2019-07-29 10:21:27 -04:00
Brad King
22d3eb5d5e Refactor checks for whether a target has an import library
Use `HasImportLibrary` for such checks.
2019-07-12 17:29:40 -04:00
Brad King
71fbebd1dc IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints.  Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
2019-07-10 11:48:56 -04:00
Sebastian Holtermann
006229278b Use cmAppend to append ranges to std::vector instances 2019-05-23 16:19:49 +02:00
Sebastian Holtermann
6d407ae439 Use cmSourceFile::GetIsGenerated 2019-02-01 17:02:53 +01:00
Sebastian Holtermann
f16dfdf71f 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.
2019-01-28 08:41:28 -05:00
Regina Pfeifer
5a0784ddea clang-tidy: Pass by value 2019-01-22 13:03:04 -05:00
Brad King
4b6b2a571c fileapi: extend codemodel v2 with directory details
Issue: #18398
Co-Author: Kyle Edwards <kyle.edwards@kitware.com>
2018-12-12 15:12:26 -05:00
Brad King
eb8c7676a4 fileapi: extend codemodel v2 with a project model
Offer clients a `project()`-centric view of the build system.  This is
similar to the directory-centric view but consolidates subdirectories
that do not call `project()` with a new project name.

Issue: #18398
Co-Author: Kyle Edwards <kyle.edwards@kitware.com>
2018-12-12 15:12:26 -05:00
Brad King
3e922ceb5e fileapi: add codemodel v2
Start with v2 to distinguish it from server-mode v1.

Issue: #18398
2018-12-12 06:40:10 -05:00