1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 04:01:40 +08:00

995 Commits

Author SHA1 Message Date
Cristian Adam
372c89ea38 Refactor -arch and -isysroot code usage 2019-12-11 12:45:16 +01:00
Brad King
edb6aa98de Merge topic 'delay-custom-command-creation'
777ceaea94 cmMakefile: Delay custom command creation
4e37508c85 cmLocalGenerator: Refactor to use cmMakeSingleCommandLine
96e5042e46 cmCustomCommand: Explicitly pass backtrace on construction
3dc084ebc1 cmMakefile: Explicitly pass backtrace to GetCustomCommandTarget
e8360afbf7 cmPluginAPI: Correct typo in documentation of FinalPass
bf76a6b801 cmMakefile: Delay CheckTargetProperties and FinalPass to generate time

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3865
2019-12-04 14:22:50 -05:00
Brad King
7525f0ec6c Merge topic 'unity-no-duplicate-path'
43ffd2c35c Unity: No repeated path for internal generated unity files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4077
2019-11-26 08:55:09 -05:00
Cristian Adam
43ffd2c35c Unity: No repeated path for internal generated unity files
Fixes: #20002
2019-11-25 13:33:44 +01:00
Daniel Eiband
777ceaea94 cmMakefile: Delay custom command creation
Move custom command creation to cmLocalGenerator and dispatch custom
commands in cmMakefile to generate time.  Generators add custom commands
using the new methods provided by cmLocalGenerator.

Issue: #12877
2019-11-24 20:32:43 +01:00
Daniel Eiband
4e37508c85 cmLocalGenerator: Refactor to use cmMakeSingleCommandLine 2019-11-24 20:13:23 +01:00
Brad King
9bc8854b3c Merge topic 'objc-standard-fix'
6a818b6931 ObjC: Proper initialization of ObjC/XX standard properties

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !4050
2019-11-15 09:06:07 -05:00
Cristian Adam
6a818b6931 ObjC: Proper initialization of ObjC/XX standard properties
Fix logic added by commit 81566557d5 (ObjC: Initialize ObjC/XX standard
properties from C/C++ counterparts, 2019-11-09) to account for cases
when the CXX standard is not explicitly set.  Also, do not copy the
`*_STANDARD_REQUIRED` and `*_EXTENSIONS` properties unless we copied the
`*_STANDARD` property.
2019-11-14 11:05:56 -05:00
Brad King
4909594abd Merge topic 'objc-standard'
81566557d5 ObjC: Initialize ObjC/XX standard properties from C/C++ counterparts

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4022
2019-11-13 09:40:47 -05:00
Cristian Adam
81566557d5 ObjC: Initialize ObjC/XX standard properties from C/C++ counterparts
Fixes: #19937
2019-11-12 19:41:25 +01:00
Brad King
ccd2c2824a Merge topic 'modernize-memory-management'
f93385283f cmLocalGenerator: modernize memory management
101b5288ff cmAlgorithm: Extend cmAppend capabilities

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4028
2019-11-12 09:55:20 -05:00
Brad King
5b46bc3194 Merge topic 'unity-HEADER_FILE_ONLY'
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:16 -05:00
Brad King
eae743bf17 Merge topic 'unity-HEADER_FILE_ONLY' into release-3.16
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4023
2019-11-12 09:51:15 -05:00
Brad King
7a08f0d8dd Merge topic 'resolve-full-path-at-generate-time' into release-3.16
48d1456b3d UnityBuild: Resolve full paths of unity source includes
ec2f130aa9 cmFileAPI: Resolve full path in PCH source comparison

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4029
2019-11-12 09:34:11 -05:00
Brad King
a085648de5 Merge topic 'resolve-full-path-at-generate-time'
48d1456b3d UnityBuild: Resolve full paths of unity source includes
ec2f130aa9 cmFileAPI: Resolve full path in PCH source comparison

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4029
2019-11-12 09:34:11 -05:00
Craig Scott
9a935adca9 Merge topic 'pch-no-duplicates'
e01935ac9d PCH: No repeated path for internal generated PCH files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4030
2019-11-12 08:28:46 -05:00
Marc Chevrier
f93385283f cmLocalGenerator: modernize memory management 2019-11-11 16:41:13 +01:00
Cristian Adam
9a5418320e Unity: Don't include sources with HEADER_FILE_ONLY property set
Fixes: #19946
Fixes: #19947
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2019-11-11 14:10:18 +01:00
Cristian Adam
e01935ac9d PCH: No repeated path for internal generated PCH files
Fixes: #19952
2019-11-11 13:21:12 +01:00
Daniel Eiband
48d1456b3d UnityBuild: Resolve full paths of unity source includes
Issue: 19927
2019-11-11 13:05:31 +01:00
Brad King
f7612a6668 Merge topic 'unity-include-generated'
7ddf462304 Unity build: Include GENERATED files into unity build

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Julien Schueller <schueller@phimeca.com>
Merge-request: !4001
2019-11-07 10:26:50 -05:00
Cristian Adam
7ddf462304 Unity build: Include GENERATED files into unity build
There is no reason to skip the generated files, in case of problems
one can use the SKIP_UNITY_BUILD_INCLUSION property.

Fixes: #19925
2019-11-06 11:47:15 -05:00
Brad King
13ea5f06fa Merge topic 'objc-pch'
e331367a89 PCH: Add support for OBJC/OBJCXX languages

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3983
2019-11-05 11:24:55 -05:00
Cristian Adam
e331367a89 PCH: Add support for OBJC/OBJCXX languages 2019-11-03 21:34:39 +01:00
Brad King
3cf71e8c7d cmLocalGenerator: Drop unused initializer in AddUnityBuild
Fix a warning from clang-scanbuild:

    warning: Value stored to 'chunk' during its initialization is never read
    for (size_t itemsLeft = filtered_sources.size(), chunk = batchSize,
                                                     ^~~~~   ~~~~~~~~~

Simply remove the initializer.
2019-10-28 15:52:55 -04:00
Cristian Adam
36ded610af PCH: Generate sources during Compute step 2019-10-09 13:50:25 +02:00
Brad King
f1fb63b306 file(GENERATE): Create output file structures even earlier
Since commit b80557c7bd (file(GENERATE): Evaluate early to allow
generating source files, 2014-11-04, v3.2.0-rc1~398^2) we create the
`cmSourceFile` instances marked with a `GENERATED` source file property
before tracing source dependencies.  Move it to even earlier so that
steps in `cmGlobalGenerator::AddAutomaticSources` can operate on all
sources.  This also avoids the accidental `O(n^2)` calls for `n` local
generators that we had previously.

This is also needed since commit 83c1657ff7 (Unity build: Generate
sources during Compute step, 2019-10-03) to support `file(GENERATE)`
outputs as sources in a target with `UNITY_BUILD` enabled.
2019-10-07 15:22:12 -04:00
Brad King
395e5f77fc Merge topic 'unity-step'
83c1657ff7 Unity build: Generate sources during Compute step

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3884
2019-10-04 10:15:08 -04:00
Cristian Adam
1144a4fa47 PCH: Add multi-language PCH generation support
If the target has C files, it will get a C PCH file.
The same for C++ files. The linker language is no
longer used to determine which language to use for
PCH.

Fixes: #19790
2019-10-03 22:58:55 +02:00
Brad King
83c1657ff7 Unity build: Generate sources during Compute step
The unity build sources need to be added for all generators.  Create
them during `cmGlobalGenerator::Compute` to avoid duplicating the calls
in every generator.  We already handle Qt autogen there too.

Issue: #19789
2019-10-03 14:55:22 -04: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
Steve Wilson
80f120a85f Languages: Add support for Objective-C
Add entries in Modules and Modules/Platform to support
Objective-C compiler determination and identification.
Add Modules to check Objective-C compiler flags, source
compilations, program checks, etc...

Use OBJC as the designator of the language, eg:

project(foo OBJC)

Add various tests for Objective-C language features.  Add
tests to preserve C++ handling of .m and .mm files when
OBJC is not a configured language.

Co-Authored-By: Cristian Adam <cristian.adam@gmail.com>
2019-09-28 15:56:46 +02:00
Daniel Eiband
f151a57705 cmMakefile: Move enumerations into new header
The enumerations will also be used in cmLocalGenerator.
2019-09-26 10:02:06 -04:00
Daniel Eiband
7dcf9cb83c cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.

Fixes: #19686
2019-09-23 21:19:15 +02:00
Daniel Eiband
1811411fec cmGeneratorExpression: Move quiet flag to cmCompiledGeneratorExpression
The quiet flag is false for all but one call to Evaluate.  Make the quiet flag
a setter of cmCompiledGeneratorExpression to be able to remove it from the
Evaluate function signature.
2019-09-22 09:49:41 +02: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
df0586d8d5 Merge topic 'pch-source-list'
9d2ac86f45 Precompile Headers: Add precompile header file to source list

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3832
2019-09-20 10:29:16 -04:00
Brad King
4ade1b00c5 Merge topic 'fileapiLinkPathAndLinkDirBacktraces'
4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES
5bd65dff7a cmLocalGenerator: Add OutputLinkLibraries overload with backtraces
5d39e792ae cmGeneratorTarget: Store backtrace for target LINK_DIRECTORIES property
7da17ef797 cmLinkLineComputer: Add ComputeLinkLibraries overload with backtraces
d4d0dd0f6a cmLinkLineComputer: Add ComputeLinkLibs overload with backtraces
0ac9dcb807 cmLinkLineComputer: Add ComputeLinkPath overload with backtraces
0c6468178a cmComputeLinkInformation: Add GetDirectoriesWithBacktraces
a209b31d0d cmComputeLinkInformation: Add AppendValues with backtraces

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3805
2019-09-20 10:22:01 -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
Cristian Adam
9d2ac86f45 Precompile Headers: Add precompile header file to source list
The precompile header file will be added to the list of files,
and be part of the newly "Precompile Header File" source group.

Also make sure the sources have the header as dependency.
2019-09-19 13:23:00 +02:00
Justin Goshi
4d6334824d fileapi: add backtraces for LINK_PATH and LINK_DIRECTORIES 2019-09-18 14:00:39 -04:00
Justin Goshi
5bd65dff7a cmLocalGenerator: Add OutputLinkLibraries overload with backtraces 2019-09-18 14:00:39 -04: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
Regina Pfeifer
f30523d090 clang-tidy: modernize-deprecated-headers 2019-09-16 10:11:13 -04:00
Brad King
1a1508c8b8 Merge topic 'modernize-use-auto'
d25a5a7ec9 clang-tidy: modernize-use-auto

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3783
2019-09-12 09:15:38 -04:00
Brad King
46629d6a49 Merge topic 'fileapiAddMoreBacktraces'
30006e199b fileapi: add backtraces for compile/link options
291c83f063 cmLocalGenerator: Add GetTargetCompileFlags overload with backtraces
8e973b8e8d cmLocalGenerator: Add GetTargetFlags overload with backtraces
4d5bbb7704 cmLocalGenerator: Add GetStaticLibraryFlags overload with backtraces
1f6a436bf4 cmLocalGenerator: Add AddCompileOptions overload with backtraces
5355a60fd0 cmLocalGenerator: Add AppendCompileOptions overload with backtraces
a20d2c85d0 cmLocalGenerator: Add AppendFlags overload with backtraces
b13207910e cmLocalGenerator: Clarify AddCompileOptions filter logic
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3775
2019-09-11 11:38:58 -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
Brad King
054d626c9c Merge topic 'MoveIfDifferent'
5b96fd5b81 use cmSystemTools::MoveFileIfDifferent()
5eaf1e1be2 cmSystemTools: introduce MoveFileIfDifferent()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3794
2019-09-10 10:58:53 -04:00