Commit Graph

871 Commits

Author SHA1 Message Date
Brad King 6c098a4a72 Merge topic 'fix-target_link_libraries-wrong-dir'
30c2e1dd cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
2015-06-26 08:41:16 -04:00
Brad King 30c2e1dd16 cmTarget: Fix diagnostic of target_link_libraries in wrong directory (#15626)
Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext
for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a
target that was defined in another (non-ancestor) directory crashes
because no execution context is left active.  Fix this by getting the
execution context from the actual cmMakefile where the current
target_link_libraries call takes place.  Test this by verifying that
such calls correctly produce an error diagnostic instead of crashing.
2015-06-25 09:14:26 -04:00
Brad King c1113705d7 Merge topic 'compiler-launcher'
698f7597 Add options to launch the compiler through tools like ccache or distcc
2015-06-15 09:45:28 -04:00
Bill Hoffman 698f75971b Add options to launch the compiler through tools like ccache or distcc
Create a <LANG>_COMPILER_LAUNCHER target property (initialized by a
CMAKE_<LANG>_COMPILER_LAUNCHER variable) to specify a compiler launcher
tool.  This will supersede the CMAKE_<LANG>_COMPILER_ARG1 approach to
using such tools.  The old approach set CMAKE_<LANG>_COMPILER to the
launcher tool while the new approach leaves this variable set to the
actual compiler.

Implement this property for Makefile and Ninja generators.  It cannot be
implemented for VS or Xcode generators as the IDE build tools offer no
such hooks.
2015-06-15 09:36:48 -04:00
Brad King d17aa60659 Merge topic 'data-layout'
8174e5cd cmCustomCommand: Remove special member functions.
34e1d6db cmCustomCommand: Re-arrange data layout.
54cb76f2 cmComputeLinkDepends: Re-arrange data layout.
b661d6c6 cmQtAutoGenerators: Re-arrange data layout.
40844a14 cmProcessTools: Re-arrange data layout.
b1ff32af cmOrderDirectories: Re-arrange data layout.
dd0417c7 cmInstallTargetGenerator: Re-arrange data layout.
125c4866 cmInstallFilesGenerator: Re-arrange data layout.
92b8b1fc cmGraphVizWriter: Re-arrange data layout.
7f3e1623 cmGlobalGenerator: Re-arrange data layout.
d9df7fa7 cmComputeComponentGraph: Re-arrange data layout.
db24e41b cmCommandArgumentParserHelper: Re-arrange data.
4cd13e80 cmComputeLinkInformation: Re-arrange data layout.
3e087a40 cmLocalUnixMakefileGenerator: Re-arrange data layout.
e0421701 cmMakefile: Re-arrange data layout.
c26696eb cmSourceFile: Re-arrange data.
...
2015-06-08 13:54:11 -04:00
Brad King f5690cc57c Merge topic 'move-Feature-API'
f573bd22 cmLocalGenerator: Add Feature API from cmMakefile.
ccbc2259 cmGeneratorTarget: Move Feature API from cmTarget.
2015-06-08 13:54:05 -04:00
Stephen Kelly 647488570b cmTarget: Replace PolicyStatus members with PolicyMap.
sizeof(cmTarget) goes from 856 to 840 with GNU libstdc++ 5.1.
2015-06-07 09:29:31 +02:00
Stephen Kelly 6f148e4a48 cmTarget: Use method abstraction for policy status. 2015-06-07 09:29:31 +02:00
Stephen Kelly 5181fae264 cmPropertyMap: Remove chaining logic.
The chaining logic doesn't belong to the container, and the
CMakeInstance pointer doesn't need to be in cmPropertyMap.

Size goes from 56 to 48 bytes with GNU libstdc++-5.1.
2015-06-07 09:29:31 +02:00
Stephen Kelly 7c0aa672fe cmPropertyMap: Remove scope parameter from API where not used. 2015-06-07 09:29:30 +02:00
Stephen Kelly ccbc225913 cmGeneratorTarget: Move Feature API from cmTarget. 2015-06-06 15:44:16 +02:00
Stephen Kelly 1cff330b0f cmTarget: Port to cmOutputConverter. 2015-06-06 09:15:57 +02:00
Brad King 0886880e3b Merge topic 'cmMakefile-Configure'
7657e8b1 cmMakefile: Introduce a local cmMakefile variable.
4e8f242d cmMakefile: Store unconfigured cmMakefiles.
d65e0123 cmMakefile: Implement ConfigureSubDirectory in terms of cmMakefile.
f059ed16 cmMakefile: Move Configure responsibility from cmLocalGenerator.
a653611d cmake: Replace CurrentLocalGenerator concept with CurrentMakefile.
69a038a9 cmMakefile: Refactor directories specified with the subdirs command.
08637970 cmLocalGenerator: ComputeObjectMaxPath just before generating.
27e11c6f Merge Configure state with GeneratingBuildSystem state.
363caa2f cmLocalGenerator: De-virtualize Configure().
2015-06-04 09:13:35 -04:00
Stephen Kelly 27e11c6fea Merge Configure state with GeneratingBuildSystem state. 2015-06-04 09:06:40 -04:00
Stephen Kelly 52919ac8ac cmMakefile: Make cmListFileBacktrace default constructible. 2015-06-03 01:03:59 +02:00
Brad King 03a65dab30 Merge topic 'run-include-what-you-use'
ada5ffce Add options to run include-what-you-use with the compiler
67fa3da9 cmake: Add internal -E mode to run include-what-you-use with the compiler
2015-05-21 09:03:40 -04:00
Brad King ada5ffce7b Add options to run include-what-you-use with the compiler
Create a <LANG>_INCLUDE_WHAT_YOU_USE target property (initialized by a
CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable) to specify an IWYU command
line to be run along with the compiler.
2015-05-19 13:16:29 -04:00
Stephen Kelly a271f7f177 cmTarget: Simplify CMP0023 message loop.
This method is only called if there is a mismatch and something to
print.  Remove intermediate container.
2015-05-18 23:55:44 +02:00
Stephen Kelly f4300cd4dd cmTarget: Simplify output computation.
We always have line information for contexts resulting from
command execution.
2015-05-18 23:55:44 +02:00
Stephen Kelly 65a4284963 cmTarget: Store context in stack only if different.
The PushTLLCommandTrace method is called once per link item for a single
target_link_libraries command.  Avoid storing copies of identical
execution contexts and rely on the uniqueness while printing output.
2015-05-18 23:55:44 +02:00
Stephen Kelly 52a8d19c9b cmTarget: Store only cmListFileContext for CMP0023 handling.
Only the top level execution context is shown, as appropriate, so
store only that.
2015-05-18 23:55:43 +02:00
Stephen Kelly 59ba1215b9 cmTarget: Remove needless iteration.
This is not a loop.
2015-05-18 23:55:43 +02:00
Brad King 2c5a1bff23 Merge topic 'refactor-cmPolicies'
013ada80 cmPolicies: Implement PolicyMap in terms of bitset.
be6664c2 cmPolicies: Implement abstraction for PolicyMap.
de211686 Port to static cmPolicies API.
13981f20 cmPolicies: Make all API static.
23e2bcc8 cmPolicies: Remove unused DefinePolicy method.
5641ba4f cmPolicies: Remove unused cmPolicy class.
3de54497 cmPolicies: Loop over all policies using enum constants.
387aff20 cmPolicies: Trivialize GetPolicyStatus method.
dbf680d6 cmPolicies: Use more-direct ID access.
8c204133 cmPolicies: Implement in terms of public API.
e3a8c029 cmPolicies: Make private method file-static.
cb765af0 cmPolicies: Implement short description access with XMacros.
5df267fa cmPolicies: Implement version check with XMacro.
2235cfeb cmPolicies: Implement id to version with XMacro.
05d84388 cmPolicies: Implement id to string conversion with XMacro.
6eaade8a cmPolicies: Introduce XMacro table for policy data.
...
2015-05-05 09:35:30 -04:00
Stephen Kelly de21168612 Port to static cmPolicies API. 2015-05-04 22:32:20 +02:00
Stephen Kelly a0836ed978 Port to cmMakefile::GetGlobalGenerator. 2015-05-03 11:42:00 +02:00
Stephen Kelly 32b8f03acc cmMakefile: Port users of GetStart* methods to new names. 2015-04-21 00:15:20 +02:00
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly b159bff732 Move property definition to cmState. 2015-04-13 20:13:13 +02:00
Brad King 62c5e6f1a1 Merge topic 'introduce-cmState'
f081c5bd cmState: Move CacheEntryType enum from cmCacheManager.
f71fdf0e cmMakefile: Remove unused CacheManager accessor.
ff7169a0 Port to cmState.
a6b1ad13 Introduce cmState class.
2015-04-13 11:45:02 -04:00
Stephen Kelly f081c5bddd cmState: Move CacheEntryType enum from cmCacheManager. 2015-04-13 11:44:16 -04:00
Stephen Kelly ade20b433b cmake: Remove DebugConfigs member.
It adds needless complexity to global property handling.
2015-04-12 20:08:47 +02:00
Matt McCormick 579c4bec6e Properties: Add CROSSCOMPILING_EMULATOR target property.
Add CROSSCOMPILING_EMULATOR target property for executables. This is used by
subsequent patches to run exectuables created for the target system when
crosscompiling. The property is initialized by the
CMAKE_CROSSCOMPILING_EMULATOR variable when defined.
2015-04-07 13:33:34 -04:00
Gregor Jasny 3714955b9c OS X: Add handling for XCTest bundles
An XCTest bundle is a CFBundle with a special product-type and bundle
extension.  For more information about XCTest visit the Mac Developer
library at:

  http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/testing_with_xcode/

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2015-03-23 09:12:18 -04:00
Stephen Kelly 7916d7bac6 Include cmAlgorithms where it is used. 2015-03-11 00:17:29 +01:00
Stephen Kelly b734fa4471 Genex: Allow COMPILE_LANGUAGE when processing include directories.
Issue an error if this is encountered by an IDE generator.
2015-03-09 20:49:17 +01:00
Stephen Kelly 0b945ea9a6 Genex: Allow COMPILE_LANGUAGE when processing compile definitions.
Issue an error if this is encountered by an IDE generator.
2015-03-09 20:49:16 +01:00
Stephen Kelly 5c559f1113 Genex: Enable use of COMPILE_LANGUAGE for compile options.
Follow-ups will allow the use of the generator expression
for compile definitions and include directories for non-IDE
generators.
2015-03-09 20:48:57 +01:00
Brad King 6dc9a627b6 Merge topic 'minor-cleanups'
c021f59c cmMakefile: Store macro list in a vector not in a map.
2d130896 cmMakefile: Fix list of macros generation.
f1969234 cmFunctionCommand: Remove ineffectual code.
1116698a cmTarget: Don't needlessly clear vectors in the destructor.
2015-02-23 10:26:42 -05:00
Stephen Kelly 1116698a89 cmTarget: Don't needlessly clear vectors in the destructor.
This will be done anyway for us.
2015-02-21 11:00:14 +01:00
Stephen Kelly 05fec779d3 cmTarget: Port loop to algorithm. 2015-02-20 21:26:17 +01:00
Stephen Kelly c697c1fafe cmTarget: Remove template argument workaround.
Pre-C++98 compilers required that the template argument be
used in the function parameters.  Those compilers are no longer
supported as hosts, so drop the workaround.
2015-02-17 19:18:11 +01:00
Stephen Kelly e21f7829a2 cmTarget: Use a sorted vector in place of a set.
The vector has a more easy-to-use API.

Join the string with cmJoin, and avoid erasing from the container
in the loop.
2015-02-11 22:58:08 +01:00
Stephen Kelly 69dbe51b08 Replace loop with algorithm. 2015-02-06 19:04:10 +01:00
Stephen Kelly 71d47115d0 Use insert member instead of back_inserter. 2015-02-06 19:04:09 +01:00
Brad King 9de2ab7fce Merge topic 'consistent-empty-method'
5f69314e Replace foo.length() pattern with !foo.empty().
fd0c036c Replace 'foo.length() >= 1' pattern with !foo.empty()
f09fde2d Replace 'foo.length() > 0' pattern with !foo.empty().
86b5bdfa Replace 'foo.length() == 0' pattern with foo.empty().
fd7b3712 Replace foo.size() pattern with !foo.empty().
aa773035 Replace !foo.size() pattern with foo.empty().
64592633 cmListCommand: Use empty() and expand whitespace.
607e1938 Replace 'foo.size() != 0' pattern with !foo.empty().
930bd478 Replace 'foo.size() == 0' pattern with foo.empty().
d92887ef Replace 'foo.size() > 0' pattern with !foo.empty().
2015-01-19 09:43:28 -05:00
Stephen Kelly 607e19384f Replace 'foo.size() != 0' pattern with !foo.empty(). 2015-01-18 14:25:24 +01:00
Stephen Kelly 681d965df1 Use the cmDeleteAll algorithm for types derived from std::map. 2015-01-17 16:22:58 +01:00
Brad King 4ecc392b42 Merge topic 'delete-algorithm'
65b81da4 cmVariableWatch: Use the cmDeleteAll algorithm with for_each.
30d2de9a cmGeneratorExpressionEvaluator: Replace own algorithm with cmDeleteAll.
4a6e795b Use the cmDeleteAll algorithm instead of trivial raw loops.
abb4a678 Add a generic algorithm for deleting items in a container.
2015-01-15 09:54:04 -05:00
Brad King 44612e7407 Merge topic 'fix-LOCATION-with-TARGET_OBJECTS'
23f3798c cmTarget: Compute link language of TARGET_OBJECTS with CMP0026 OLD (#15338)
2015-01-15 09:53:59 -05:00
Stephen Kelly 4a6e795b0c Use the cmDeleteAll algorithm instead of trivial raw loops. 2015-01-13 23:00:17 +01:00