1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-06-21 12:10:05 +08:00

638 Commits

Author SHA1 Message Date
Matthias Maennich
a45928cdeb Fix some occurrences of missing override keywords
Fix issues diagnosed by clang-tidy [modernize-use-override].

These occurrences are only showing up on OSX.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:41 -04:00
Matthias Maennich
bb0ad1bea8 Fix some occurrences using string by value rather than by const&
Fix issues diagnosed by clang-tidy
 - performance-unnecessary-value-param
 - performance-unnecessary-copy-initialization

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:40 -04:00
Matthias Maennich
8cc33aeaec Replace several occurrences of empty string comparisons by string::empty()
Fix issues diagnosed by clang-tidy [readability-container-size-empty]

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-28 07:23:40 -04:00
Matthias Maennich
f0489856e3 Retire std::auto_ptr and its macro CM_AUTO_PTR
Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-26 00:07:19 +02:00
Matthias Maennich
a5279ae553 Use C++11 nullptr (cont.)
Fix remaining occurrences of the issue addressed in commit 5962db4389
(Use C++11 nullptr, 2017-08-22) that are only showing up on macOS.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
2017-09-19 11:44:21 -04:00
Brad King
0b33aee48b Use C++11 override instead of CM_OVERRIDE
We now require C++11 support including `override`.  Drop use of
the old compatibility macro.  Convert references as follows:

    git grep -l CM_OVERRIDE -- '*.h' '*.hxx' '*.cxx' |
      xargs sed -i 's/CM_OVERRIDE/override/g'
2017-09-15 10:06:41 -04:00
Daniel Pfeifer
2b4c32c95f clang-format: format all code as Cpp11 2017-08-30 11:07:05 -04:00
Brad King
ebe436eb97 Merge topic 'cxx11-nullptr'
5962db43 Use C++11 nullptr

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1175
2017-08-25 11:26:24 -04:00
Brad King
53305ce5b0 Merge topic 'revert-xcode-9-new-buildsystem-support'
9ecee256 Xcode: Revert addition of "outputPaths" to custom command build phase

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1183
2017-08-25 11:05:05 -04:00
Daniel Pfeifer
5962db4389 Use C++11 nullptr 2017-08-24 23:39:47 +02:00
Brad King
9ecee256f8 Xcode: Revert addition of "outputPaths" to custom command build phase
The change in commit v3.9.0~3^2 (Xcode: Add "outputPaths" to custom
command script build phase, 2017-07-13) was meant to support Xcode 9's
new build system.  However, without matching "inputPaths", Xcode will
not re-run the build phase if its outputs have already been generated.
This broke the old Xcode build system too.

Revert the change for now so at least the old Xcode build system works.
Further investigation will be needed to add proper support for Xcode 9's
new build system.

Fixes: #17178
2017-08-24 10:56:48 -04:00
Aaron Orenstein
7bc6577017 Performance: Fix a few more unnecessary vector copies missed in af3fd6f 2017-08-18 07:59:52 -07:00
Brad King
8ff5aeb7cb Merge topic 'xcode9support'
0348383b Xcode: Add "outputPaths" to custom command script build phase

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1054
2017-07-17 10:26:37 -04:00
Harry Mallon
0348383b8c Xcode: Add "outputPaths" to custom command script build phase
This is needed for Xcode 9's "New Build System", whose release notes
mention "that output must be declared as an explicit output by the
script which generates it" in reference to outputs of custom script
build phases.
2017-07-14 10:38:00 -04:00
Brad King
15c5d9a0dd Merge topic 'xcode-cross-sdk-object-libraries'
c2a6df94 Xcode: Use correct Object Library paths for cross-SDK builds

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1016
2017-06-30 10:32:02 -04:00
Gregor Jasny
c2a6df94ed Xcode: Use correct Object Library paths for cross-SDK builds
When calculating Object Library paths take a look at the
`XCODE_EMIT_EFFECTIVE_PLATFORM_NAME` property to enable builds with
different SDKs. Otherwise a hard-coded architecture could be chosen.

Fixes: #16040
2017-06-29 09:52:44 -04:00
Gregor Jasny
fe34a5c82b Xcode: Add XCTest support to schema generator
Closes: #16961
2017-06-28 22:21:52 +02:00
Brad King
ba247ccaba IPO: Consider support for each language separately
We only define `INTERPROCEDURAL_OPTIMIZATION` behavior for C, CXX, and
Fortran languages.  Do not try to enable support for other languages.
Furthermore, each language builds with a different compiler, so check
for support by CMake and the compiler for each language independently.

Fixes: #16944
2017-06-14 10:36:57 -04:00
Pavel Solodovnikov
8b6f439ef2 Access string npos without instance 2017-06-01 14:19:51 -04:00
Brad King
c608000a2a Xcode: Work around xcodebuild spurious hangs in try_compile
`xcodebuild` occasionally hangs on some macOS machines (and can be
reproduced independent of CMake).  It only happens a few times in 1000
runs, but configuration of a large project calls `try_compile` many
times and therefore frequently hangs due to this problem.  I've been
unable to reproduce the hang when using a scheme to build, so always
generate a scheme in `try_compile` projects to work around the problem.

Issue: #16752
2017-05-15 13:05:46 -04:00
Brad King
b8e707a6a1 Xcode: Refactor internal decision for scheme generation
Move the Xcode version check out to wrap everything.
2017-05-15 13:02:09 -04:00
Brad King
ef9c9c92f5 Merge topic 'remove-top-level-xcode-groups'
01cd88c0 Xcode: Remove the top-level Sources and Resources groups

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !779
2017-05-04 10:31:05 -04:00
Matt Stevens
01cd88c0e5 Xcode: Remove the top-level Sources and Resources groups
This addresses duplicate file reference warnings from xcodebuild caused
by the same file reference being a member of both the target's group and
the top-level Resources group. Since resources are already a member of
their associated target's group the top-level Resources group isn't
strictly necessary, and removing it results in a project structure
closer to that of a current Xcode project template.

Fixes: #15272
2017-05-03 11:05:42 -04:00
Ruslan Baratov
7e75568b00 Xcode: Support IPO (LTO) 2017-05-02 18:33:25 +03:00
Brad King
a8667467ea Add IPO compiler flags more consistently in generators
Move addition of IPO flags into `cmLocalGenerator::AddLanguageFlags`
because all call sites of that need the IPO flags, but not all were
following the call with `AppendFeatureOptions`.
2017-04-27 16:15:07 -04:00
Brad King
7373b389eb Xcode: Drop support for Xcode versions below 3 2017-04-22 15:19:11 -04:00
Brad King
eaf53849ec Xcode: Compute version number earlier 2017-04-21 13:10:28 -04:00
Brad King
5b241d0ae8 Merge topic '16760-refactor-get-mac-content-directory'
cf320f7c Replace boolean `implib` parameters with enum

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !662
2017-04-21 08:53:16 -04:00
Gregor Jasny
cf320f7cd7 Replace boolean implib parameters with enum
Named enumeration values are much clearer at call sites and add more
type safety.
2017-04-20 10:22:33 -04:00
Gregor Jasny
ffdde4a9ae Xcode: Use SYSTEM_HEADER_SEARCH_PATHS attribute for system includes
Closes #16795
2017-04-19 22:28:50 +02:00
Brad King
25f3f22a1a cmGlobalGenerator: Add method to check if object file location is known
Add a `HasKnownObjectFileLocation` method returning whether we know the
exact location of object files produced by the native build system.
This is true everywhere except on Xcode when an architecture placeholder
is used.
2017-04-18 09:03:33 -04:00
Brad King
e44a8d2c32 Xcode: Refactor loop over all sources
Switch from `GetConfigCommonSourceFiles` to `GetAllConfigSources`.
This will allow us to drop object library files from the former.
2017-04-13 16:10:33 -04:00
Brad King
2f6f6f0c15 Xcode: Use config-specific object library files on link lines
We can do this only with Xcode 5 and above where we list the object
library files in the per-config link line value.  On older Xcode
versions we list the object files as sources so that dependencies work
correctly, but that does not allow per-config objects.  (Xcode may allow
per-config source exclusion but only by base name.)
2017-04-13 16:10:32 -04:00
Brad King
e155fba644 Merge topic 'xcode-remove-UseObjectLibraries'
229abfc8 cmGeneratorTarget: Drop unused UseObjectLibraries method
63fbf587 Xcode: Inline relevant parts of UseObjectLibraries
1afacebe Xcode: Do not add Object Libraries source group on Xcode >= 5

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !698
2017-04-13 08:15:25 -04:00
Brad King
8456ec833a Merge topic 'include-style'
1d829c86 Use quotes for non-system includes
26ee9e42 CPack: drop CPack prefix for includes
5afac50f cmConfigure: Ensure separate include block in headers

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !691
2017-04-13 08:12:40 -04:00
Brad King
63fbf58750 Xcode: Inline relevant parts of UseObjectLibraries 2017-04-12 15:38:35 -04:00
Brad King
1afacebee9 Xcode: Do not add Object Libraries source group on Xcode >= 5
The group is always empty because on Xcode 5 and above we list
object library files directly on the link line and do not list
sources for them.
2017-04-12 15:30:35 -04:00
Daniel Pfeifer
1d829c862c Use quotes for non-system includes
Automate with:

git grep -l '#include <cm_' -- Source \
  | xargs sed -i 's/#include <\(cm_.*\)>/#include "\1"/g'

git grep -l '#include <cmsys/' -- Source \
  | xargs sed -i 's/#include <\(cmsys\/.*\)>/#include "\1"/g'

git grep -l '#include <cm[A-Z]' -- Source \
  | xargs sed -i 's/#include <\(cm[A-Z].*\)>/#include "\1"/g'
2017-04-11 22:35:21 +02:00
Brad King
8c346bbc6e Xcode: Compute a concrete object file arch dir if possible 2017-04-11 11:40:15 -04:00
Brad King
5f4e26dfc8 Xcode: Refactor object directory name computation
Factor out a helper function to compute the object directory name
architecture component.
2017-04-11 11:40:15 -04:00
Brad King
5b29fd6d4d Xcode: Refactor internal architecture list construction
Factor population of the `Architectures` member out into a helper to
avoid duplication.
2017-04-11 11:40:15 -04:00
Bastien Schatt
38fd5866c0 Add GENERATOR_IS_MULTI_CONFIG global property
Fixes: #16768
2017-04-04 09:49:00 -04:00
Brad King
8772fc81c4 Merge topic 'ipo-policy-CMP0069'
dfa8263f Implement interprocedural optimization for GNU compilers
1588a577 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
a7575700 Refactoring: s,GetFeatureAsBool,IsIPOEnabled,
e05835c3 CheckIPOSupported: Visual Studio and Xcode generators do not support IPO

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Nils Gladitz <nilsgladitz@gmail.com>
Merge-request: !568
2017-03-31 10:38:08 -04:00
Ruslan Baratov
1588a577d1 Add policy CMP0069 to enforce INTERPROCEDURAL_OPTIMIZATION
Previously the `INTERPROCEDURAL_OPTIMIZATION` target property was
honored only for the Intel compiler on Linux and otherwise ignored.  In
order to add support for more compilers incrementally without changing
behavior in the future, add a new policy whose NEW behavior enforces the
`INTERPROCEDURAL_OPTIMIZATION` property.  Add flags for supported
compilers and otherwise produce an error.
2017-03-30 14:56:46 -04:00
Brad King
7bb8b38cce Merge topic '16742-swift-3.0'
77139e32 Swift: Simplify mixed test case to make it version agnostic
c03141c0 Swift: Default to Swift 3.0 with Xcode 8.3 and later

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !638
2017-03-30 08:52:37 -04:00
Gregor Jasny
c03141c04c Swift: Default to Swift 3.0 with Xcode 8.3 and later
Xcode 8.3 has dropped support for Swift 2.3 so that compiler and
feature detection failed.

Closes #16742
2017-03-28 16:06:29 -04:00
Gregor Jasny
c51c2cfac6 Apple: Fix Resources location for all generators
Issue: #16680
2017-03-23 16:43:55 +01:00
Gregor Jasny
060be58c6f Xcode: Properly handle Bundle Resources with more than one hierarchy level
Issue: #16680
2017-03-22 23:36:11 +01:00
Gregor Jasny
484ccb0c45 Xcode: Properly handle non-resource Bundle files on iOS
Issue: #16680
2017-03-22 21:16:42 +01:00
Gregor Jasny
cf13e49544 Xcode: Control schema generation via variable
Issue: #15441
2017-03-12 21:24:46 +01:00