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

969 Commits

Author SHA1 Message Date
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
Gregor Jasny
7202db5db4 Xcode: Fix schema container location calculation 2017-02-28 22:38:29 +01:00
Gregor Jasny
5995082101 Xcode: Do not autocreate schemes 2017-02-28 22:38:29 +01:00
Brad King
0aec4d3864 Merge topic 'cmake-xcode-schemes'
7238a052 Xcode: Add documentation for schema generator
ffb8817b Xcode: Write shared schemes based on the default files generated by Xcode
2017-02-28 09:39:12 -05:00
Gusts Kaksis
ffb8817b37 Xcode: Write shared schemes based on the default files generated by Xcode
Issue: #15441
2017-02-28 09:21:54 -05:00
Gregor Jasny
5da9266af5 Xcode: Always track object library dependencies via hacky Makefile
Always use the dependency tracker Makefile to ensure targets that
depend on object libraries are up-to-date.  For all other target
types we use the hack only for Xcode < 5.

Fixes: #16615
2017-02-22 15:20:11 -05:00
Gregor Jasny
e80ac95303 Xcode: Record dependency information also for object libraries
Xcode seems to have troubles to track target dependecies to
object files. This may lead to stale targets as reported in
issue #16615.

As a work-around the pre-Xcode 5 dependecy tracker hack with
post-build make files is extended to also take object libraries
into account.
2017-02-22 17:05:18 +01:00
Gregor Jasny
9293e57d9c Xcode: Collect dummy rules during iteration and emit afterwards 2017-02-22 17:05:17 +01:00
Gregor Jasny
33a1d727d5 Makefile: Allow adding post-build rules to object libraries 2017-02-22 17:05:17 +01:00
Gregor Jasny
071f8e78dd Apple: Add support for static frameworks
Closes: #16432
2017-01-31 08:59:15 -05:00
Gregor Jasny
10c9c73d58 Xcode: Control emission of EFFECTIVE_PLATFORM_NAME
When building with multiple SDKs within one project Xcode requires
the usage of ${EFFECTIVE_PLATFORM_NAME} to put temporary and build
outout into separate directories. For example an iOS device and
simulator build use two different SDKs (iphoneos and iphonesimulator).

In the past cmake tries to detect embedded toolchains that could
possibly use simulators and emitted EFFECTIVE_PLATFORM_NAME (EPN)
at the proper locations. In #16253 Mark noticed that if he
uses macosx and iphoneos in combination the necessary EPN is not
emitted. This is because CMake by default assumes macosx SDK which
does not trigger EPN emission.

The fist naive approach - enabling EPN unconditionally revealed that
then the EPN leaks into generator expressions like $<TARGET_FILE:xxx>
which might be a regression and thus is unacceptable.

The next approach was to add an CMake property to enable EPN emission
unconditionally. This solved the reported problem.

But the EPN leakage also happened for the embedded toolchains already
without anyone noticing. So the control property was turned into a
tri-state one:

 * No definition: EPN is activated for embedded toolchains like before
 * ON: EPN is always emitted
 * OFF: EPN is never emitted

That approach gives the user the chance to disable EPN for embedded
toolchains and restores generator expression functionality for those.

Closes: #16253
2017-01-20 13:51:48 -05:00
Gregor Jasny
88f07fb417 Xcode: Properly mark SYSTEM includes as such
We now populate the per-language flags in addition to the header
search paths stored in HEADER_SEARCH_PATHS. This preserves include
paths for GNU assembly files (cmake/cmake#16449) and also provides
SYSTEM include semantics.

Closes: cmake/cmake#15687
2016-12-27 22:18:30 +01:00
Gregor Jasny
0ae4632119 Xcode: Add target property to override explicitFileType 2016-12-04 00:13:51 +01:00
Gregor Jasny
7ecac703ce Xcode: Add target property to override productType 2016-12-04 00:13:08 +01:00
Brad King
4093bd4025 Merge topic 'include-what-you-use'
d0c14dfb avoid including cmStandardIncludes.h
66a70999 iwyu: Fix VisualStudio specific issues
7b4244ac iwyu: Fix more findings
aeff60e4 iwyu: Fix OSX specific issues
2016-11-28 14:24:07 -05:00
Brad King
8a975efc94 Merge topic '16449-revert-xcode-system-includes'
543dcb0a Revert "Xcode: Obey SYSTEM keyword for includes (#15687)"
2016-11-28 14:23:21 -05:00
Gregor Jasny
543dcb0ada Revert "Xcode: Obey SYSTEM keyword for includes (#15687)"
Revert commit v3.7.0-rc1~266^2 (Xcode: Obey SYSTEM keyword for includes,
2015-08-31).  It worked for C, C++, and Swift but not for GNU Assembly
files for which Xcode has no property to set flags.

Closes: #16449
2016-11-28 13:42:46 -05:00
Daniel Pfeifer
aeff60e44c iwyu: Fix OSX specific issues 2016-11-23 00:41:44 +01:00
Zsolt Parragi
1e4bb35894 Add generator expression support to per-source COMPILE_FLAGS
This allows users to specify different genex-based compile flags for
each file in a target, e.g. compiling just a single file with `Od/Ox` in
release builds on Visual Studio.
2016-10-28 11:18:03 -04:00
Brad King
2d3aa94225 cmGlobalGenerator: Allow FindMakeProgram to fail
Revise its signature to return `bool` so that it can fail and abort
configuration early.
2016-10-20 10:37:27 -04:00