1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-20 11:47:23 +08:00

1301 Commits

Author SHA1 Message Date
Brad King
f0e67da061 target_link_libraries: Fix out-of-dir linking of a list of targets
In a case like

    target_link_libraries(targetInOtherDir PUBLIC "$<1:a;b>")

then all entries in the list need to be looked up in the caller's
scope.  Previously our `::@(directory-id)` suffix would apply only
to the last entry.  Instead surround the entire entry by a pair
`::@(directory-id);...;::@` so that the `::@` syntax can encode
a directory lookup scope change evaluated as the list is processed.

Fixes: #20204
2020-01-16 13:24:27 -05:00
Brad King
05738b5f21 Merge topic 'pch_job_pool'
97c124e30f Ninja: Add a separate job pool for PCH creation
ebd0b16ddb vim: Add target_precompile_headers command highlighting

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !4224
2020-01-16 10:33:48 -05:00
Dan Johnston
97c124e30f Ninja: Add a separate job pool for PCH creation
Add a `JOB_POOL_PRECOMPILE_HEADER` target property to specify the pool
name, and its associated `CMAKE_JOB_POOL_PRECOMPILE_HEADER` variable.

Fixes: #20217
2020-01-16 10:32:25 -05:00
Marc Chevrier
f466cea3c9 cmMakefile: modernize memory management 2020-01-14 11:03:07 +01:00
Brad King
eb672da7d4 Merge topic 'objc-compiler-launcher'
f6ef6e5a73 Merge branch 'backport-3.16-objc-compiler-launcher'
1a9f6bad98 ObjC: Add _COMPILE_LAUNCHER support
a05b9d4239 ObjC: Add _COMPILE_LAUNCHER support

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4189
2020-01-10 13:18:35 -05:00
Cristian Adam
1a9f6bad98 ObjC: Add _COMPILE_LAUNCHER support
Fixes: #20178
2020-01-09 13:52:37 -05:00
Luca Cappa
353405daef Add support for FOLDER target property to custom targets
Fixes: #18372
2020-01-09 11:55:12 -05:00
Cristian Adam
a05b9d4239 ObjC: Add _COMPILE_LAUNCHER support
Fixes: #20178
2020-01-09 11:35:23 -05:00
Brad King
0607a50bb3 Merge topic 'add-header-cmext-algorithm'
f7d12609f0 Refactoring: use append functions from cmext/algorithm
a38d04c076 Refactoring: introduce header cmext/algorithm with append functions

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4131
2019-12-18 09:32:03 -05:00
Brad King
64e2891cbd Merge topic 'stdstring-target'
c34b4497f8 cmTarget: add std::string overloads

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4137
2019-12-17 11:09:20 -05:00
Marc Chevrier
f7d12609f0 Refactoring: use append functions from cmext/algorithm 2019-12-17 10:44:02 +01:00
Vitaly Stakhovsky
c34b4497f8 cmTarget: add std::string overloads 2019-12-14 09:30:28 -05:00
Kyle Edwards
5a8a9f7229 Ninja: Add multi-config variant
Co-Authored-by: vector-of-bool <vectorofbool@gmail.com>
2019-12-13 10:51:46 -05:00
Gregor Jasny
92c4c852db Xcode: Add custom working directory property
Closes: #19967
2019-11-18 22:34:34 +01:00
Brad King
e14c9af013 Merge topic 'pch-reuse-no-prop'
bb4c2781ce PCH: Do not issue an error on duplicate target_precompile_headers call

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4046
2019-11-18 09:46:26 -05:00
Cristian Adam
bb4c2781ce PCH: Do not issue an error on duplicate target_precompile_headers call
Fixes: #19970
2019-11-15 09:47:56 -05:00
Brad King
5c8d821eca Merge topic 'xcode-scheme-env'
f0005dacde Xcode: Add CMAKE_XCODE_SCHEME_ENVIRONMENT variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3933
2019-10-25 09:37:49 -04:00
Felix Heidrich
f0005dacde Xcode: Add CMAKE_XCODE_SCHEME_ENVIRONMENT variable
Initialize the `XCODE_SCHEME_ENVIRONMENT` target property.

This was left out of commit 6b7f1e1db0 (Xcode: Add variables and
properties to configure schemes, 2018-07-29, v3.13.0-rc1~243^2).
2019-10-24 11:24:34 -04:00
Alexander Boczar
e7d57bc3c3 VS: Propagate CMAKE_VS_GLOBALS into custom targets
Issue: #19708
2019-10-17 10:19:01 -04:00
Brad King
7cccc5b199 Xcode: Restore CMAKE_XCODE_GENERATE_SCHEME for custom targets
The target property introduced by commit 413b71485a (Xcode: Create Xcode
schemes per target, 2019-03-11, v3.15.0-rc1~347^2) was accidentally not
initialized by `CMAKE_XCODE_GENERATE_SCHEME` for custom targets.  Fix it
and update the test.

Fixes: #19759
2019-10-02 08:21:02 -04:00
Brad King
d57c1a5b31 Merge topic 'clang-format-normalize-headers-presentation'
ed98209ddc Revise include order using clang-format-6.0
185fe49f29 clang-format: Normalize headers presentation
42ef28b4f3 Remove unused uid_t/gid_t types on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Sebastian Holtermann <sebholt@web.de>
Merge-request: !3851
2019-10-02 07:53:43 -04:00
Brad King
0c5f78478e Merge topic 'xcode-debug-document-versioning'
67200c37b0 xcode: Add XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3876
2019-10-02 07:51:06 -04:00
Gregor Jasny
67200c37b0 xcode: Add XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING property 2019-10-01 23:02:35 +02:00
Kitware Robot
ed98209ddc Revise include order using clang-format-6.0
Run the `clang-format.bash` script to update our C and C++ code to a new
include order `.clang-format`.  Use `clang-format` version 6.0.
2019-10-01 12:26:36 -04:00
Brad King
9b03baee30 Merge topic 'objective-c-cxx'
dd0f304613 Objective C/C++: Add compiler standard detection
b515af782b Help: Add release note for Objective-C/C++ language support
9e66397c28 Languages: Add support for Objective-C++
80f120a85f Languages: Add support for Objective-C

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3811
2019-09-30 10:25:19 -04:00
Cristian Adam
dd0f304613 Objective C/C++: Add compiler standard detection 2019-09-28 15:56:53 +02:00
Daniel Eiband
91abf9f3c4 cmCustomCommand: Move custom commands 2019-09-26 10:02:08 -04:00
Brad King
ebb9346490 Merge topic 'cmake-system-headers'
4a08690ccf cmstd: Extend header <cm/iterator>
c688b401d3 cmstd: Modernize CMake system headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3776
2019-09-20 10:38:43 -04:00
Brad King
541e681da2 Merge topic 'split-custom-command-creation'
0e1faa28cb cmMakefile: Separate custom command setup from actual creation
56c204e8eb cmMakefile: Refactor AddCustomCommandOldStyle to be delay friendly
3061dc6ac9 add_custom_command: Add tests for rejecting literal quotes in commands
e893ab94ba cmMakefile: Validate command line for all custom commands
f1e846fdde cmMakefile: Extract custom command validation method
4926ab2454 cmMakefile: Create all generated byproducts as known sources

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3822
2019-09-20 10:24:32 -04:00
Marc Chevrier
c688b401d3 cmstd: Modernize CMake system headers
Provide a standardized way to handle the C++ "standard" headers
customized to be used with current CMake C++ standard constraints.
Offer under directory `cm` headers which can be used as direct
replacements of the standard ones.  For example:

    #include <cm/string_view>

can be used safely for CMake development in place of the `<string_view>`
standard header.

Fixes: #19491
2019-09-20 10:01:37 -04:00
Brad King
9c31d83aa2 Merge topic 'autogen_path_prefix'
cc0900d9cd Help: Add release notes for AUTOMOC_PATH_PREFIX
692d8e3492 Help: Add documentation for AUTOMOC_PATH_PREFIX
1933ade9f1 Tests: At QtAutogen.MocIncludeSymlink test
706d9738a6 Tests: Merge QtAutogen.MocIncludeStrict and MocIncludeRelaxed
d018d27c10 Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)
77983c8147 Autogen: Add IsHeader flag to SourceFileT class
f9e5441eb4 Autogen: Abbreviate file paths in messages
51676cf655 Autogen: Split JobEvalCacheT job into separate moc and uic jobs
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3818
2019-09-19 11:19:52 -04:00
Daniel Eiband
0e1faa28cb cmMakefile: Separate custom command setup from actual creation
Refactor custom command manipulation functions to consist of a setup and a
commit stage.  The commit stage will be delayed to generate time.
2019-09-17 22:52:32 +02:00
Cristian Adam
729d997f10 Precompile Headers: Add REUSE_FROM signature
Add the ability to share precompiled headers artifacts between
targets.

Fixes: #19659
2019-09-17 11:58:38 +02:00
Sebastian Holtermann
d018d27c10 Autogen: Add moc path prefix generation (AUTOMOC_PATH_PREFIX)
The new `AUTOMOC_PATH_PREFIX` boolean target property enables automatic
generation of the path prefix `-p` option for `moc`.
`AUTOMOC_PATH_PREFIX` is initialized from the variable
`CMAKE_AUTOMOC_PATH_PREFIX`, which is ON by default.

When `AUTOMOC_PATH_PREFIX` is enabled, CMake tests if a `moc`ed header file is
in one of the include directories.  If so, then the `-p` option, with the
relative path of the header parent directory to the respective include
directory, is added to the `moc` command.  If the header file is not in an
include directory, the `-p` option is omitted.

Closes: #18815 "AUTOMOC: generated files include full relative path,
                breaking certain reproducible builds"
2019-09-16 18:18:48 +02:00
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Regina Pfeifer
d25a5a7ec9 clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order
to limit the diagnostics to iterators.  Leave new expressions and cast
expressions for later.
2019-09-10 22:21:41 +02:00
Cristian Adam
7114c141e2 Unity build: Add support for Ninja and Makefile generators 2019-08-29 16:44:09 +02:00
Brad King
fa36e2151d Merge topic 'precompile-headers'
8da78d4efe Precompile headers: Update documentation
5772930164 Precompile headers: Add unit tests
519606704e Precompile headers: Add support for Visual Studio generators
28be170fbc Precompile headers: Add support for Xcode generator
b8626261e9 Precompile headers: Add methods to generate PCH sources
375d01c680 PCH: add example/test
9b6797e71d PCH: add target_precompile_headers command
0467a2f91b PCH: add PRECOMPILE_HEADERS to special properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
Acked-by: Ivan171 <heavenandhell171@gmail.com>
Acked-by: Stanislav Ershov <digital.stream.of.mind@gmail.com>
Acked-by: Steve Mokris <smokris@softpixel.com>
Acked-by: Evgeniy Dushistov <dushistov@mail.ru>
Acked-by: Danila Malyutin <flashmozzg@gmail.com>
Acked-by: Viktor Kirilov <vik.kirilov@gmail.com>
Acked-by: Lucas Zhao <zhaopf6@163.com>
Merge-request: !3553
2019-08-29 09:38:21 -04:00
Brad King
613ac3e7d5 Merge topic 'swift-version'
369c48ee43 Swift: honour `-swift-version` in Ninja generator

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3685
2019-08-27 10:57:26 -04:00
Daniel Pfeifer
0467a2f91b PCH: add PRECOMPILE_HEADERS to special properties 2019-08-26 18:16:42 +02:00
Saleem Abdulrasool
369c48ee43 Swift: honour -swift-version in Ninja generator
Swift has supported `CMAKE_Swift_LANGUAGE_VERSION` and
`Swift_LANGUAGE_VERSION` but didn't apply that to Ninja generated
targets.  Consider the property when calculating the flags.
2019-08-26 11:38:40 -04:00
Brad King
37c671570c Merge topic 'source_sweep_ostringstream_single'
3b2b02825d Source sweep: Replace std::ostringstream when used with a single append

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3726
2019-08-26 10:49:10 -04:00
Sebastian Holtermann
3b2b02825d Source sweep: Replace std::ostringstream when used with a single append
This replaces `std::ostringstream`, when it is written to only once.
If the single written argument was numeric, `std::to_string` is used instead.
Otherwise, the single written argument is used directly instead of the
`std::ostringstream::str()` invocation.
2019-08-23 18:52:33 +02:00
Sebastian Holtermann
aaf59120bf Source sweep: Replace cmExpandList with the shorter cmExpandedList
This replaces the code pattern
```
std::vector<std::string> args;
cmExpandList(valueStr, args, ...)
```
with
```
std::vector<std::string> args = cmExpandedList(valueStr, ...)
```
2019-08-23 17:07:49 +02:00
Sebastian Holtermann
9b334397f5 Source sweep: Use cmStrCat for string concatenation
This patch is generated by a python script that uses regular expressions to
search for string concatenation patterns of the kind

```
std::string str = <ARG0>;
str += <ARG1>;
str += <ARG2>;
...
```

and replaces them with a single `cmStrCat` call

```
std::string str = cmStrCat(<ARG0>, <ARG1>, <ARG2>, ...);
```

If any `<ARGX>` is itself a concatenated string of the kind

```
a + b + c + ...;
```

then `<ARGX>` is split into multiple arguments for the `cmStrCat` call.

If there's a sequence of literals in the `<ARGX>`, then all literals in the
sequence are concatenated and merged into a single literal argument for
the `cmStrCat` call.

Single character strings are converted to single char arguments for
the `cmStrCat` call.

`std::to_string(...)` wrappings are removed from `cmStrCat` arguments,
because it supports numeric types as well as string types.

`arg.substr(x)` arguments to `cmStrCat` are replaced with
`cm::string_view(arg).substr(x)`
2019-08-22 16:38:10 +02:00
Sebastian Holtermann
20e580be01 Source sweep: Use cmIsOn instead of cmSystemTools::IsOn
This replaces invocations of

- `cmSystemTools::IsInternallyOn` with `cmIsInternallyOn`
- `cmSystemTools::IsNOTFOUND` with `cmIsNOTFOUND`
- `cmSystemTools::IsOn` with `cmIsOn`
- `cmSystemTools::IsOff` with `cmIsOff`
2019-08-17 12:14:14 +02:00
Sebastian Holtermann
f4f3c68926 Source code: Use cmExpandList instead of cmSystemTools::ExpandListArgument 2019-08-14 16:33:20 +02:00
Kyle Edwards
7099d113ae Merge topic 'support_CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS'
8f1d22c2d9 CUDA: Support CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS global variable

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3636
2019-08-13 09:58:03 -04:00
Robert Maynard
8f1d22c2d9 CUDA: Support CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS global variable 2019-08-06 09:55:40 -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