Commit Graph

21683 Commits

Author SHA1 Message Date
Stephen Kelly
a9bf981a4c cmState: Move Snapshot type to separate namespace
Leave behind a typedef to avoid porting dependent code in this commit.
2016-10-19 15:40:58 +02:00
Stephen Kelly
17d27893e6 cmState: Port dependent code to new cmStateDirectory name 2016-10-19 15:40:58 +02:00
Stephen Kelly
34bcec39c6 cmState: Move Directory class to separate namespace
Leave behind a typedef to avoid porting dependent code in this commit.
2016-10-19 15:40:58 +02:00
Stephen Kelly
2fe3e55d53 cmState: Move CacheEntryType enum to separate namespace
Port dependent code to the change.
2016-10-19 15:40:58 +02:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02:00
Brad King
876da11858 CMake 3.7.0-rc2 2016-10-19 08:53:08 -04:00
Brad King
050ef26061 Merge topic 'cmake-server-pipe-mode-fix'
9112c43e server-mode: Fix named pipe mode
2016-10-19 08:48:27 -04:00
Kitware Robot
674d76538e CMake Nightly Date Stamp 2016-10-19 00:01:04 -04:00
Daniel Pfeifer
fb461cacba silence selected clang-tidy violations 2016-10-18 22:56:47 +02:00
Brad King
3a9e92bce1 Ninja: Add compile rules only for languages that are actually compiled
In `WriteLanguageRules` we collect all languages used for source files
in a target.  However, this only needs to include sources that are
actually going to be compiled into object files.  No object file build
statements will be generated for other sources.

This avoids generating language compile rules for source files that
are not compiled due to being marked as `HEADER_FILE_ONLY`.

Issue: #16373
2016-10-18 15:35:10 -04:00
Stephen Kelly
0060391dff cmState: Move SnapshotType enum to separate namespace 2016-10-18 21:28:46 +02:00
Stephen Kelly
5bc964eddb cmState: Move PositionType to separate namespace
Remove friend declarations supporting it being a nested type.
2016-10-18 21:28:46 +02:00
Stephen Kelly
2dc4099648 cmState: Move PolicyStackEntry to separate namespace 2016-10-18 21:28:45 +02:00
Stephen Kelly
cb40af5d6f cmState: Move SnapshotDataType to separate namespace 2016-10-18 21:28:45 +02:00
Stephen Kelly
1205f75e3b cmState: Move nested struct into separate top-level namespace
Add a friend declaration to give the struct access to
cmState::PositionType.  This will be removed when that type is also
extracted.
2016-10-18 21:28:45 +02:00
Stephen Kelly
163991dd83 cmServerProtocol: Remove unused header 2016-10-18 21:28:45 +02:00
Stephen Kelly
51f89932c0 cmCommandArgumentParserHelper: Remove unused header 2016-10-18 21:28:44 +02:00
Brad King
074999171c Merge branch 'cmake-server-pipe-mode-fix' into release 2016-10-18 13:12:02 -04:00
Tobias Hunger
9112c43ebc server-mode: Fix named pipe mode
Do not treat a pointer itself as a `uv_stream_t`, but instead the
pointed-to `uv_pipe_t`.  It is unclear how this ever worked before in
local testing.

While at it, remove duplicate setup code and improve an error message.
2016-10-18 10:55:01 -04:00
Brad King
a5f0e62988 Merge topic 'timeout_after_match_testtime'
909842ff CTest: report time spent after matching output
2016-10-18 08:43:03 -04:00
Brad King
99177a2029 Merge topic 'propagate_ctest_use_launchers'
19beee46 ctest_configure: Propagate CTEST_USE_LAUNCHERS from caller to project
2016-10-18 08:43:00 -04:00
Brad King
9519d79b63 Merge topic 'math-EXPR-unary'
2810e561 math(EXPR): Add support for unary `+` and `-` expressions
834f52a6 cmExprParser: Revise indentation style to match rest of CMake
7aaed265 cmExprParser: Port to bison 3
2016-10-18 08:42:54 -04:00
Kitware Robot
e46350ffd9 CMake Nightly Date Stamp 2016-10-18 00:01:03 -04:00
Zack Galbreath
909842fff9 CTest: report time spent after matching output
When using the TIMEOUT_AFTER_MATCH test property, only report the
time spent by the test after the matching output was found.
2016-10-17 11:24:32 -04:00
Bill Hoffman
19beee46cc ctest_configure: Propagate CTEST_USE_LAUNCHERS from caller to project
If `CTEST_USE_LAUNCHERS` is `TRUE` in a CTest script then the
`ctest_configure` command will add `-DCTEST_USE_LAUNCHERS:BOOL=TRUE` to
the cmake command used to configure the project.  This allows a project
to only set `CTEST_USE_LAUNCHERS` in a ctest script and have launchers
work.
2016-10-17 11:15:36 -04:00
Brad King
188c762f8a Merge topic 'extract-computed-target-properties'
cef59bb8 cmTarget: Implement GetProperty in terms of cmState::Snapshot
0d57b07a cmTarget: Group code for checking written properties together
c3fb0d95 cmTarget: Move sanity checks and computed property access to callers
fa9dbc56 cmGeneratorTarget: Implement cmTargetPropertyComputer interface
848ae2a6 cmTargetPropertyComputer: Template some methods on the Target
a0a720e6 cm{,Generator}Target: Add global generator accessors
637e3f3e cmTargetPropertyComputer: Unify whitelist handling from cmTarget
05251e6d cmTargetPropertyComputer: Move whitelist check from cmTarget
fbf1721c cmTargetPropertyComputer: Extract into new files
390a7d86 cmTargetPropertyComputer: Implement GetProperty without cmMakefile
e32a6bdd cmListFileBacktrace: Add a method to retrieve the Bottom of a snapshot
7863fba1 cmTarget: Extract GetLocation method
8096682e cmTarget: Extract GetSources method
7d57c1a2 cmTarget: Extract location computation methods
a55cac4b cmTarget: Split property computation into separate class
705fcf52 cmTarget: Move IMPORTED check to callers
...
2016-10-17 10:15:21 -04:00
Brad King
9a2048f1ea Merge topic 'extract-cmRulePlaceholderExpander'
b59b6dd9 cmRulePlaceholderExpander: Port clients to direct-use
bdddd423 cmRulePlaceholderExpander: Extract from cmLocalGenerator
f796e1b6 cmLocalGenerator: Move memset to cxx file
c75a9d66 cmLocalGenerator: Use strings instead of a Target in rule replacement
46ad0d21 cmLocalGenerator: Use a converter in rule replacement API
2628dec1 cmLocalGenerator: Store variable replacements as state
315b9a31 cmLocalGenerator: Merge loops which populate mapping
d5feb5b3 cmLocalGenerator: Populate variable mapping for all replacements
efba22e1 cmLocalGenerator: Extract compiler option replacement from loop
b29425f7 cmLocalGenerator: Populate a container of mappings for replacements
f009d8f5 cmLocalGenerator: Move compiler option handling to be more direct
6cd27a85 cmLocalGenerator: Move variable to where it can be used easily
8b0e4795 cmLocalGenerator: Use the language from the compiler container
88016e2e cmLocalGenerator: Introduce a container of compiler names
be87cb0c cmLocalGenerator: Simplify loop with range algorithm
425cd167 cmLocalGenerator: Remove the launcher from RuleVariables
2016-10-17 10:15:17 -04:00
Brad King
248527ed93 Merge topic 'refactor-folder-name-retrieval'
3b6f1587 Factor IDE folder name retrieval out into helper method
2016-10-17 10:15:15 -04:00
Brad King
274ff52092 Merge topic 'cmcldeps-more-safety'
70e268da cmcldeps: prefer the /TC flag
47092d3e cmcldeps: append strings as strings
7db671a1 cmcldeps: search for single-byte strings as characters
2016-10-17 10:15:12 -04:00
Gregor Jasny
3b6f1587be Factor IDE folder name retrieval out into helper method
Add a `cmGeneratorTarget::GetEffectiveFolderName` helper to abstract
lookup of the `FOLDER` property in combination with checking for
generator support of folders.
2016-10-17 10:06:18 -04:00
Kitware Robot
0cbe2edb23 CMake Nightly Date Stamp 2016-10-17 00:01:03 -04:00
Stephen Kelly
cef59bb8ba cmTarget: Implement GetProperty in terms of cmState::Snapshot 2016-10-16 13:57:53 +02:00
Stephen Kelly
0d57b07ad9 cmTarget: Group code for checking written properties together 2016-10-16 13:57:53 +02:00
Stephen Kelly
c3fb0d95ad cmTarget: Move sanity checks and computed property access to callers
The GetProperty method is now just accessing contained data, meaning it
can be implemented in cmState.

Remove the cmMakefile context from the signature as a result and remove
the overload with the same signature.

Add a GetComputedProperty to cmTarget so that templates can be properly
instantiated.  Otherwise the Commands would need to be able to reach the
specializations which are currently in cmTarget.cxx.

As a side-effect, the CMP0026 warning now gives a backtrace to the
target when issued from a generator expression.
2016-10-16 13:56:12 +02:00
Kitware Robot
5ebba22882 CMake Nightly Date Stamp 2016-10-16 00:01:17 -04:00
Stephen Kelly
b59b6dd9d2 cmRulePlaceholderExpander: Port clients to direct-use
Add a factory function to cmLocalGenerator so that variableMappings can
be provided from it, and so that Ninja can always have a hard-coded
TargetImpLib.
2016-10-15 11:25:12 +02:00
Stephen Kelly
bdddd4234e cmRulePlaceholderExpander: Extract from cmLocalGenerator
Implement cmLocalGenerator::ExpandRuleVariables in terms of the new
class for source compatibility and to reduce diff noise in this commit.
2016-10-15 11:25:12 +02:00
Stephen Kelly
f796e1b6f6 cmLocalGenerator: Move memset to cxx file 2016-10-15 11:25:12 +02:00
Stephen Kelly
c75a9d6601 cmLocalGenerator: Use strings instead of a Target in rule replacement
Don't rely on the cmGeneratorTarget type needlessly.
2016-10-15 11:25:12 +02:00
Stephen Kelly
46ad0d2183 cmLocalGenerator: Use a converter in rule replacement API
The rule replacement API should not really be in cmLocalGenerator, but
it was historically, and this coupled many other things together here
too, such as output conversion.  Make the output converter a parameter
so that rule replacement can be removed from cmLocalGenerator.
2016-10-15 11:25:12 +02:00
Stephen Kelly
2628dec12c cmLocalGenerator: Store variable replacements as state
These do not change over the lifetime of the cmLocalGenerator.
2016-10-15 11:25:12 +02:00
Stephen Kelly
315b9a3189 cmLocalGenerator: Merge loops which populate mapping 2016-10-15 11:25:12 +02:00
Stephen Kelly
d5feb5b34c cmLocalGenerator: Populate variable mapping for all replacements
This reduces the final replacement to a simple query in the map, which
is much more readable than what was here before.
2016-10-15 11:25:12 +02:00
Stephen Kelly
efba22e1de cmLocalGenerator: Extract compiler option replacement from loop
There is no need to be in the loop.  Being there just adds to
complexity.
2016-10-15 11:25:12 +02:00
Stephen Kelly
b29425f7aa cmLocalGenerator: Populate a container of mappings for replacements
The same variables are replaced/retrieved from cmMakefile again and
again.  Use a container so that they don't have to be retrieved
repeatedly, and to simplify the nested loop.
2016-10-15 11:25:12 +02:00
Stephen Kelly
f009d8f5e2 cmLocalGenerator: Move compiler option handling to be more direct 2016-10-15 11:25:12 +02:00
Stephen Kelly
6cd27a853a cmLocalGenerator: Move variable to where it can be used easily 2016-10-15 11:25:12 +02:00
Stephen Kelly
8b0e479568 cmLocalGenerator: Use the language from the compiler container
This is just to make follow-up diffs smaller.
2016-10-15 11:25:12 +02:00
Stephen Kelly
88016e2e9f cmLocalGenerator: Introduce a container of compiler names
Use it to determine when a rule replacement should gain extra options.
2016-10-15 11:25:12 +02:00
Stephen Kelly
be87cb0c44 cmLocalGenerator: Simplify loop with range algorithm 2016-10-15 11:25:12 +02:00
Stephen Kelly
425cd1670f cmLocalGenerator: Remove the launcher from RuleVariables
This one is not like the others as it doesn't participate in
substitutions.  Keep ExpandRuleVariables doing only one thing and make
callers responsible for inserting a launcher prefix, simplifying the
code all-around.

Remove now-obsolete InsertRuleLauncher method.
2016-10-15 11:25:12 +02:00
Stephen Kelly
fa9dbc56a1 cmGeneratorTarget: Implement cmTargetPropertyComputer interface
Populate a local member for the sources property when the instance is
created.  Pass the parameter to avoid the policy check when doing so.
Ordinarily, the GetSources function should not be called unconditionally
(at generate time), but we need to do so here in case the property is
read in a generator expression.  The intent is to be able to implement
cmGeneratorTarget without requiring cmTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
848ae2a663 cmTargetPropertyComputer: Template some methods on the Target
Implement the methods for cmTarget in the cmTarget source.
2016-10-15 11:14:21 +02:00
Stephen Kelly
a0a720e6a7 cm{,Generator}Target: Add global generator accessors
Provide 'static polymorphism' between the types in this aspect so that
they can be used indiscriminately in a C++ template.
2016-10-15 11:14:21 +02:00
Stephen Kelly
637e3f3ee1 cmTargetPropertyComputer: Unify whitelist handling from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
05251e6d80 cmTargetPropertyComputer: Move whitelist check from cmTarget 2016-10-15 11:14:21 +02:00
Stephen Kelly
fbf1721c94 cmTargetPropertyComputer: Extract into new files 2016-10-15 11:14:21 +02:00
Stephen Kelly
390a7d8647 cmTargetPropertyComputer: Implement GetProperty without cmMakefile
Only a cmMessenger and a backtrace are needed.
2016-10-15 11:14:21 +02:00
Stephen Kelly
e32a6bdd99 cmListFileBacktrace: Add a method to retrieve the Bottom of a snapshot 2016-10-15 11:14:21 +02:00
Stephen Kelly
7863fba1f6 cmTarget: Extract GetLocation method 2016-10-15 11:14:21 +02:00
Stephen Kelly
8096682e4e cmTarget: Extract GetSources method 2016-10-15 11:14:21 +02:00
Stephen Kelly
7d57c1a2c9 cmTarget: Extract location computation methods 2016-10-15 11:14:21 +02:00
Stephen Kelly
a55cac4ba4 cmTarget: Split property computation into separate class
Everything related to property computation will be moved here and
eventually shared with cmGeneratorTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
705fcf522b cmTarget: Move IMPORTED check to callers
This way the policy can be checked without depending on cmTarget.
2016-10-15 11:14:21 +02:00
Stephen Kelly
1fb6f672bd cmTarget: Move SOURCES property computation before the rest
The SOURCES have to be computed.
2016-10-15 11:14:21 +02:00
Stephen Kelly
60b3f216c1 cmTarget: Remove mutable marker from properties 2016-10-15 11:14:21 +02:00
Stephen Kelly
aaa5dbbf64 cmTarget: Use static storage for computed properties
Avoid having to populate a mutable container to return a value.
2016-10-15 11:14:21 +02:00
Kitware Robot
ac5b80e76c CMake Nightly Date Stamp 2016-10-15 00:01:10 -04:00
Brad King
2810e56182 math(EXPR): Add support for unary + and - expressions
Closes: #8996
2016-10-14 15:35:15 -04:00
Brad King
834f52a6f4 cmExprParser: Revise indentation style to match rest of CMake 2016-10-14 15:30:50 -04:00
Brad King
7aaed265ad cmExprParser: Port to bison 3
Use %-directives to specify the scanner/lexer arguments and update the
yyerror signature.  Reduce the list of post-bison modifications needed.
2016-10-14 15:30:49 -04:00
Ben Boeckel
70e268da3e cmcldeps: prefer the /TC flag
The /TC flag causes all source files to be processed as C source files.
We know that there is only one, so this is safe.
2016-10-14 09:27:43 -04:00
Ben Boeckel
47092d3e80 cmcldeps: append strings as strings 2016-10-14 09:27:43 -04:00
Ben Boeckel
7db671a143 cmcldeps: search for single-byte strings as characters 2016-10-14 09:27:43 -04:00
Brad King
a8513d8a80 Merge topic 'vs-host-x64-tools'
d079e71c VS: Provide an option to use x64 host tools
779939a0 Help: Document VS and Xcode toolset selection
2016-10-14 09:25:34 -04:00
Brad King
d079e71c29 VS: Provide an option to use x64 host tools
Visual Studio provides toolchains that are themselves built for 32-bit
or 64-bit host architectures.  By default it uses the 32-bit tools, but
it can be told to prefer the 64-bit tools on 64-bit hosts.  Extend the
`CMAKE_GENERATOR_TOOLSET` specification to provide a way to request
use of the 64-bit host tools.

Closes: #15622
2016-10-14 09:22:26 -04:00
Brad King
eb923da2c4 Merge topic 'flush-archive-list'
39b08858 cmSystemTools: Flush output buffer for list_item_verbose
2016-10-14 09:02:51 -04:00
Brad King
8b496672fe Merge topic 'st2-exclude-patterns-variable'
19ffc072 Sublime: Exclude build tree from source tree project only optionally
2016-10-14 09:02:45 -04:00
Brad King
dabd177922 Merge topic 'ninja-framework-POST_BUILD'
20278872 Ninja: Fix POST_BUILD commands on macOS Frameworks
2016-10-14 09:02:43 -04:00
Brad King
03622ee2d0 Merge topic 'ninja-rc-regression'
9977899d Ninja: Fix RC language depfile generation with cmcldeps
2016-10-14 09:02:40 -04:00
Brad King
f0579e2fda Merge topic 'LINK_WHAT_YOU_USE-allow-OFF'
2f79b22c Merge branch 'backport-LINK_WHAT_YOU_USE-allow-OFF' into LINK_WHAT_YOU_USE-allow-OFF
33cb0173 Honor LINK_WHAT_YOU_USE when set to OFF
933e54d3 Honor LINK_WHAT_YOU_USE when set to OFF
2016-10-14 09:02:36 -04:00
Kitware Robot
4c921e5c7b CMake Nightly Date Stamp 2016-10-14 00:01:08 -04:00
Brad King
a975b21cec Merge branch 'ninja-framework-POST_BUILD' into release 2016-10-13 14:09:43 -04:00
Brad King
20278872e3 Ninja: Fix POST_BUILD commands on macOS Frameworks
The condition added by commit v2.8.12~179^2 (OS X: Fix regression
handling frameworks for Ninja, 2013-07-16) for excluding use of
versioning symlinks on macOS Frameworks must match that used for
POST_BUILD selection.  Otherwise we place the POST_BUILD commands after
a symlink step that is never added.

Closes: #16363
2016-10-13 14:04:12 -04:00
Brad King
2d6fba6780 Merge branch 'backport-LINK_WHAT_YOU_USE-allow-OFF' into release 2016-10-13 13:38:28 -04:00
Jamie Snape
33cb0173d5 Honor LINK_WHAT_YOU_USE when set to OFF
Explicitly setting variable CMAKE_LINK_WHAT_YOU_USE or property
LINK_WHAT_YOU_USE to OFF should not cause LWYU to run.  Fix the
property lookup to use GetPropertyAsBool.
2016-10-13 13:34:35 -04:00
Jamie Snape
933e54d3cc Honor LINK_WHAT_YOU_USE when set to OFF
Explicitly setting variable CMAKE_LINK_WHAT_YOU_USE or property
LINK_WHAT_YOU_USE to OFF should not cause LWYU to run.  Fix the
property lookup to use GetPropertyAsBool.
2016-10-13 13:32:22 -04:00
Brad King
f6386a768e Merge branch 'ninja-rc-regression' into release 2016-10-13 13:15:46 -04:00
Ben Boeckel
9977899df2 Ninja: Fix RC language depfile generation with cmcldeps
In commit v3.7.0-rc1~275^2 (Ninja: Use full path for all source files,
2016-08-05), the source path was changed to use an absolute path.
Inside of `cmcldeps` for `.rc` file compilation, it uses a separate
argument for the path to the source file.  This ended up causing
`cmcldeps` to transform the following call:

    cmcldeps.exe RC source.rc ... C:/full/path/to/source.rc

into:

    ... C:/full/path/to//Tc source.rc

which is invalid.  Update the source filename to use the full path to
the source file so that the path is replaced properly.
2016-10-13 13:03:57 -04:00
Dāvis Mosāns
39b08858f6 cmSystemTools: Flush output buffer for list_item_verbose
When `std::cout` and `FILE *stdout` are used at same time need to
explicitly flush otherwise they can be out of sync.
2016-10-13 09:24:45 -04:00
Brad King
9273eed404 Merge topic 'msbuild-json'
ccdc3d30 Add a script to convert from MSBuild XML to a JSON format
2016-10-13 09:03:32 -04:00
Brad King
1b592b6458 Merge topic 'vs-default-generator'
5380948f cmake: Fix default VS generator selection for Microsoft Build Tools
1aee54ed cmake: Simplify default generator search by switching direction
24c86e1c cmake: Use array iteration for default generator VS variants
6db64ad4 cmake: Use array iteration for default generator list
d3df00ae cmake: Rename default generator selection list variable
10160f69 cmake: Rename default generator selection internal variable
0838d20e cmake: Simplify VS registry entry lookup
8f33de92 cmake: Factor out default generator selection into helper
2016-10-13 08:26:07 -04:00
Brad King
2be36b0ab5 Merge topic 'remove-obsolete'
b6a174d2 Makefiles: Remove query for CMAKE_OBJECT_NAME
d0faa58a Makefiles: Remove forbidden flag logic
2016-10-13 08:25:58 -04:00
Brad King
3b07c58dbd Merge topic 'vs15-separate-flag-table'
b1d67ae8 VS: Split flag table between v140 and v141 toolsets
2016-10-13 08:25:52 -04:00
Brad King
0123500309 Merge topic 'cmake-gui-fix-extra-generator-names'
bf86012a cmake-gui: Fix "extra" generator entries in drop-down list
2016-10-13 08:25:49 -04:00
Kitware Robot
429cc18fca CMake Nightly Date Stamp 2016-10-13 00:01:04 -04:00
Don Olmstead
ccdc3d300f Add a script to convert from MSBuild XML to a JSON format
This will supersede the `cmparseMSBuildXML.py` script once we have
support for loading the JSON files instead of using hard-coded flag
tables.
2016-10-12 14:40:18 -04:00
Bruno Pedrosa
19ffc0729f Sublime: Exclude build tree from source tree project only optionally
Create a `CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE` variable to control
addition of the build tree to `folder_exclude_patterns` in the
`.sublime-project`.  Change the default of this behavior to OFF.

Closes: #16351
2016-10-12 12:38:00 -04:00
Kitware Robot
8eb6038d0d CMake Nightly Date Stamp 2016-10-12 00:01:04 -04:00
Brad King
5380948fae cmake: Fix default VS generator selection for Microsoft Build Tools
Some versions of the VS tools do not install the registry entry

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\$v;InstallDir

but all appear to set

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\$v\Setup\VC;ProductDir

Update our search to consider both entries.

Closes: #16360
2016-10-11 13:39:58 -04:00
Brad King
1aee54ed87 cmake: Simplify default generator search by switching direction
Search from newest to oldest and stop once found.
2016-10-11 13:32:33 -04:00
Brad King
24c86e1c3f cmake: Use array iteration for default generator VS variants 2016-10-11 13:19:01 -04:00
Brad King
6db64ad432 cmake: Use array iteration for default generator list 2016-10-11 13:17:48 -04:00
Brad King
d3df00ae53 cmake: Rename default generator selection list variable 2016-10-11 13:16:24 -04:00
Brad King
10160f691c cmake: Rename default generator selection internal variable 2016-10-11 11:50:56 -04:00
Brad King
0838d20e50 cmake: Simplify VS registry entry lookup 2016-10-11 11:46:45 -04:00
Brad King
8f33de92ba cmake: Factor out default generator selection into helper 2016-10-11 11:30:46 -04:00
Brad King
d0255d55e1 Merge branch 'cmake-gui-fix-extra-generator-names' into release 2016-10-11 08:42:16 -04:00
Brad King
bf86012ada cmake-gui: Fix "extra" generator entries in drop-down list
Refactoring in commit v3.7.0-rc1~291^2~1 (Refactor extra generator
registration to use factories, 2016-07-20) accidentally switched
the order of the "extra - base" generator names to "base - extra".
Switch it back.  While this could affect all callers of the
`GetRegisteredGenerators` method, only cmake-gui actually used this
particular field.

Closes: #16359
2016-10-11 08:39:44 -04:00
Kitware Robot
2fb8e5b1c4 CMake Nightly Date Stamp 2016-10-11 00:01:06 -04:00
Stephen Kelly
4134030434 cmLinkLineComputer: Extract link libraries computation from cmLocalGenerator
Hide some methods which no longer need to be public.
2016-10-10 20:38:59 +02:00
Stephen Kelly
f03d446e96 cmLinkLineComputer: Move FrameworkPath computation from cmLocalGenerator
Add UseWatcomQuote state, and remove corresponding method parameters.
2016-10-10 20:38:59 +02:00
Stephen Kelly
3444105f9f cmLocalGenerator: Inline last use of local variable 2016-10-10 20:38:59 +02:00
Stephen Kelly
77c4202edc cmLinkLineComputer: Move RPath computation from cmLocalGenerator
Add state for Relink and populate it at the point of cmLinkLineComputer
initialization.  This allows removal of the parameter in go-between
methods.
2016-10-10 20:38:59 +02:00
Stephen Kelly
09b6cc66b0 cmLinkLineComputer: Move LinkPath computation from cmLocalGenerator
Add a ConvertToOutputForExisting method which can be made virtual later
to satisfy different generator needs.

Pass additional strings as parameters for now.  They can be turned into
class state later.
2016-10-10 20:38:58 +02:00
Stephen Kelly
0c97806325 cmLinkLineComputer: Move ComputeLinkLibs from cmLocalGenerator
Add a cmOutputConverter to the cmLinkLineComputer and factory methods to
facilitate shell escapes.

Add state to the cmLinkLineComputer to record whether outputting for
response files or for watcom, to satisfy the cmOutputConverter API.
These are constant for the lifetime of the cmLinkLineComputer, even when
its functionality is extended in the future.  This also keeps the
signatures of cmLinkLineComputer relatively simple.

Pass the cmComputeLinkInformation as a method parameter so that
cmLinkLineComputer is free from target-specific state.  An instance
should be usable for all targets in a directory.
2016-10-10 20:38:58 +02:00
Stephen Kelly
0152a01f11 cmLocalGenerator: Move variable to where it is used 2016-10-10 20:38:57 +02:00
Stephen Kelly
011e6870e4 cmLocalGenerator: Use a std::string instead of char* 2016-10-10 20:38:56 +02:00
Stephen Kelly
cbca80f351 cmLocalGenerator: Move stringstream to where it is used 2016-10-10 20:38:56 +02:00
Stephen Kelly
d48f69d0f5 cmLocalGenerator: Move flag determination up in the function
This content is independent of any targets.
2016-10-10 20:38:55 +02:00
Stephen Kelly
ff8e321c6a cmLocalGenerator: Separate stdlib content from library stream 2016-10-10 20:38:55 +02:00
Stephen Kelly
80f57e67ee cmLocalGenerator: Separate rpath content from library stream 2016-10-10 20:38:55 +02:00
Stephen Kelly
7ef8346825 cmLocalGenerator: Pass link library info to OutputLinkLibraries
Remove the cmGeneratorTarget from the interface.

This is simplification of the OutputLinkLibraries responsibilities so
that it can be broken apart into multiple methods.
2016-10-10 20:38:54 +02:00
Stephen Kelly
6929581206 Makefiles: Port CreateLinkLibs to cmLinkLineComputer 2016-10-10 20:38:54 +02:00
Stephen Kelly
5b361fdda0 cmLinkLineComputer: Extract from cmLocalGenerator
CMake has several classes which have too many responsibilities.
cmLocalGenerator is one of them.  Start to extract the link line
computation.  Create generator-specific implementations of the interface
to account for generator-specific behavior.

Unfortunately MSVC60 has different behavior to everything else and CMake
still generates makefiles for it.  Isolate it with MSVC60-specific
names.
2016-10-10 20:38:53 +02:00
Stephen Kelly
2e5d1990f3 Ninja: Constify 2016-10-10 20:38:53 +02:00
Stephen Kelly
b3701f9a52 cmLocalGenerator: Inline conversion into link computation
Make it possible to invoke this functionality independent of
cmLocalGenerator.
2016-10-10 20:38:52 +02:00
Brad King
271170144a Merge branch 'vs15-separate-flag-table' into release 2016-10-10 11:46:20 -04:00
Brad King
b1d67ae8a5 VS: Split flag table between v140 and v141 toolsets
In commit v3.7.0-rc1~156^2~1 (VS: Update v140 flag tables from VS 15
MSBuild files, 2016-09-02) we extended the v140 flag table with values
from the v141 toolset that comes with VS 15.  However, the v140 toolset
that comes with VS 14 does not have all of these entries and so the
flags just need to be passed without special mapping.  In order to
support both toolsets, split our CL flag table into separate copies for
each version and switch off the toolset name.

Closes: #16352
2016-10-10 11:43:39 -04:00
Brad King
1e6aaefdee Merge topic 'clean-up-link-configuration'
a1cfc4fe cmMakefile: Simplify programmer error to an assert
4079ba20 cmMakefile: Implement LinkLibraries as an internal property
17ab8e33 cmMakefile: Inline method into only remaining caller
7edfcd0e cmMakefile: Inline method into caller
6c8dc7f1 cmake: Simplify find-package mode library addition
1efca9f4 cmMakefile: Remove obsolete parameter
d9b5f0a3 cmTarget: Remove target name from parameter list
1c70c6cc cmMakefile: Use public API to find a target
2b7baed7 cmMakefile: Inline method into only caller
7ba95492 cmMakefile: Use public API to find a target
6d98b15f cmMakefile: Invert if() condition to remove else
869037ee cmMakefile: Remove ALIAS check
2f6462a6 cmMakefile: Collapse two consecutive if()s into one
148b83a1 cmMakefile: DeMorgan-invert condition
4457a9f1 cmMakefile: Return after error and remove else condition
4d039c5b cmMakefile: Invert handling of error condition
...
2016-10-10 10:23:45 -04:00
Brad King
ea533eb715 Merge topic 'ninja-cleanups'
cc5e6b82 Ninja: Extract identical code from condition
d9fde87d Ninja: Replace array access with local variable
d92c160d Ninja: Separate two coupled calls
2016-10-10 10:23:42 -04:00
Brad King
8fe948c54c Merge topic 'minor-cleanups'
c637e0c5 cmMakefile: Return a string from GetDefineFlags
fbc1b75c Test: Remove condition for CMake version no longer supported
3d0e95f6 cmLocalGenerator: Extract definition retrieval out of loop
2a49d86d Makefiles: Inline only use of method
b0301db2 Makefiles: Make helper class independent of cmLocalGenerator
267e0209 cmMakefile: Remove pointless condition
009019f2 Makefiles: Extract identical code from condition
378849f4 Makefiles: Replace array access with local variable
4a3c49b4 Makefiles: Separate two coupled calls
2016-10-10 10:23:39 -04:00
Brad King
e8cdbec45e Merge topic 'update-kwsys'
c22f3cf7 Merge branch 'upstream-KWSys' into update-kwsys
bf28a387 KWSys 2016-10-07 (dfe9b386)
2016-10-10 10:23:30 -04:00
Brad King
d3f1fcf6d1 Merge topic 'android-export-has-cpp'
dda6775c Android: Record use of C++ by static libs in exported Android.mk files
2016-10-10 10:23:27 -04:00
Stephen Kelly
c637e0c53b cmMakefile: Return a string from GetDefineFlags
Flip condition in GHS for readability.
2016-10-10 10:09:54 -04:00
Stephen Kelly
3d0e95f64c cmLocalGenerator: Extract definition retrieval out of loop 2016-10-10 10:09:54 -04:00
Kitware Robot
e3c5aed6ae CMake Nightly Date Stamp 2016-10-10 00:01:04 -04:00
Stephen Kelly
b6a174d2bc Makefiles: Remove query for CMAKE_OBJECT_NAME
it is not set.
2016-10-09 10:58:33 +02:00
Stephen Kelly
d0faa58a51 Makefiles: Remove forbidden flag logic
This might have been needed some day in the past, but not anymore.
2016-10-09 10:58:33 +02:00
Stephen Kelly
2a49d86d5d Makefiles: Inline only use of method 2016-10-09 10:47:44 +02:00
Stephen Kelly
b0301db23b Makefiles: Make helper class independent of cmLocalGenerator
It only needs output conversion.
2016-10-09 10:47:44 +02:00
Stephen Kelly
267e02097e cmMakefile: Remove pointless condition
This method is never called with an empty string.
2016-10-09 10:47:44 +02:00
Stephen Kelly
009019f259 Makefiles: Extract identical code from condition 2016-10-09 10:47:43 +02:00
Stephen Kelly
378849f41e Makefiles: Replace array access with local variable 2016-10-09 10:47:43 +02:00
Stephen Kelly
4a3c49b469 Makefiles: Separate two coupled calls 2016-10-09 10:47:43 +02:00
Kitware Robot
785bfae867 CMake Nightly Date Stamp 2016-10-09 00:01:05 -04:00
Stephen Kelly
cc5e6b82c2 Ninja: Extract identical code from condition 2016-10-08 11:36:02 +02:00
Brad King
9f240cff8a Merge branch 'update-kwsys' into release 2016-10-08 05:28:15 -04:00
Brad King
c22f3cf715 Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
  KWSys 2016-10-07 (dfe9b386)
2016-10-08 05:25:35 -04:00
Kitware Robot
8312fd5c1f CMake Nightly Date Stamp 2016-10-08 00:01:07 -04:00
Stephen Kelly
a1cfc4fe3d cmMakefile: Simplify programmer error to an assert 2016-10-07 22:08:03 +02:00
Stephen Kelly
4079ba20d9 cmMakefile: Implement LinkLibraries as an internal property
cmMakefile should not have logic particular to individual cmake
commands.  The link_libraries() command is generally obsolete in favor
of target_link_libraries().  An alternative language for CMake probably
would not offer the former.  The quirks and historical behaviors of the
current language should be separate from the core classes of CMake to
allow replacing the language.
2016-10-07 22:07:50 +02:00
Stephen Kelly
17ab8e33f0 cmMakefile: Inline method into only remaining caller 2016-10-07 22:07:16 +02:00
Stephen Kelly
d9fde87d1a Ninja: Replace array access with local variable 2016-10-07 21:37:38 +02:00
Stephen Kelly
d92c160db3 Ninja: Separate two coupled calls 2016-10-07 21:37:38 +02:00
Stephen Kelly
7edfcd0e83 cmMakefile: Inline method into caller
The various uses of AddLinkLibraryForTarget are going away.  This is the
only remaining non-deprecated use.
2016-10-07 21:25:41 +02:00
Brad King
5d8da06d60 Merge branch 'android-export-has-cpp' into release 2016-10-07 15:03:15 -04:00
Brad King
dda6775c94 Android: Record use of C++ by static libs in exported Android.mk files
When a `PREBUILT_STATIC_LIBRARY` uses C++ in its sources then the `.a`
file will have a link-time dependency on the C++ runtime libraries.
Android NDK r14 will add a way to give this information to the NDK build
system by adding a `LOCAL_HAS_CPP` setting to the `Android.mk` file.
Add this for exported static libraries that use C++.
2016-10-07 15:02:42 -04:00
Stephen Kelly
6c8dc7f1df cmake: Simplify find-package mode library addition
It does not need the cmMakefile version.
2016-10-07 20:23:19 +02:00
Stephen Kelly
1efca9f427 cmMakefile: Remove obsolete parameter 2016-10-07 20:13:36 +02:00
Stephen Kelly
d9b5f0a301 cmTarget: Remove target name from parameter list
Use the member state instead.
2016-10-07 20:13:36 +02:00
Stephen Kelly
1c70c6cc09 cmMakefile: Use public API to find a target 2016-10-07 20:13:35 +02:00
Stephen Kelly
2b7baed719 cmMakefile: Inline method into only caller
cmMakefile should not have API which is only useful for deprecated
systems like cmPluginAPI.
2016-10-07 20:13:35 +02:00
Stephen Kelly
7ba954925a cmMakefile: Use public API to find a target 2016-10-07 20:13:35 +02:00
Stephen Kelly
6d98b15fc8 cmMakefile: Invert if() condition to remove else 2016-10-07 20:13:35 +02:00
Stephen Kelly
869037ee86 cmMakefile: Remove ALIAS check
This method is only called from the cmPlugin API, which predates ALIAS
targets and is obsolete.
2016-10-07 20:13:35 +02:00
Stephen Kelly
2f6462a634 cmMakefile: Collapse two consecutive if()s into one 2016-10-07 20:13:34 +02:00
Stephen Kelly
148b83a121 cmMakefile: DeMorgan-invert condition 2016-10-07 20:13:34 +02:00
Stephen Kelly
4457a9f181 cmMakefile: Return after error and remove else condition 2016-10-07 20:13:34 +02:00
Stephen Kelly
4d039c5b46 cmMakefile: Invert handling of error condition 2016-10-07 20:13:34 +02:00
Stephen Kelly
c8ec8d6a7e cmMakefile: Remove superfluous overload
Explicit is better than implicit.
2016-10-07 20:13:34 +02:00
Stephen Kelly
3e8d47d18b cmMakefile: Remove useless link directory container
It is never populated - a find will never find anything.
2016-10-07 20:13:33 +02:00
Stephen Kelly
3b4895fa35 cmTarget: Inline MergeLinkLibraries into only caller 2016-10-07 20:13:33 +02:00
Stephen Kelly
2232e97a6e cmTarget: Remove useless link library state 2016-10-07 20:13:33 +02:00
Stephen Kelly
9a1d4e4ba1 cmTarget: Remove addition of zero when merging link libraries
The size is always zero when this is called.
2016-10-07 20:13:33 +02:00
Stephen Kelly
8391b3015a cmTarget: Add assert about link data
MergeLinkLibraries is called only from

 cmMakefile::AddGlobalLinkInformation

which is only called immediately after creating a target.
2016-10-07 20:13:32 +02:00
Brad King
b4fab15fc7 Merge topic 'nmake-encoding'
c666f8cb NMake: Use ANSI encoding for NMake Makefiles
f00214aa cmGeneratedFileStream: Add optional encoding support
bb1d3370 codecvt: Add class for encoding conversion
2016-10-07 09:22:08 -04:00
Domen Vrankar
bb8cf52156 CPack/RPM single debuginfo packaging
Generate a single debuginfo package even
if components packaging is enabled.

This makes issue #15668 resolution feature complete.

Closes: #15486
2016-10-07 09:19:04 -04:00
Domen Vrankar
758f58b4a1 CPack/RPM learned defining main component
Main component rpm package is generated
without component suffix in filename
and package name.
2016-10-07 09:19:04 -04:00
Brad King
9c4d105680 Merge topic 'cleanup-Convert'
20e62f74 cmLocalGenerator: Simplify ConvertToLinkReference
fd93b360 cmOutputConverter: Add a flag for IsUnix
1365e18b Convert: Inline platform-specific methods
1ed5f6b3 Makefiles: Introduce local RelativePath method
8377d9e0 Fortran: Inline conversion to relative path
00173b71 Fortran: Wrap path convert in a call with a more-suitable name
d5911ef0 Makefiles: Hardcode the relative location of the CMakeCache file
c3264f48 Convert: Extract method to determine if paths are in directory
52168f32 Convert: Remove asserts which are duplicated in delegate method
5213f893 Convert: Remove early return check
b61c268b Convert: Extract local variables for readability
e278f5a8 Convert: Extract local variables
51bc6bdd cmOutputConverter: remove unused code
8e0c1599 Xcode: Inline ConvertToRelativePath calls
2016-10-07 09:10:57 -04:00
Brad King
89b03498ef Merge topic 'CMP0065-LINK_FLAGS'
0f1fedbd CMP0065: Put computed flags into LINK_FLAGS not LINK_LIBRARIES
7f1cd328 cmLocalGenerator: Rename local variable to be more appropriate
2597bcf8 cmLocalGenerator: Extract policy handling into a method
2016-10-07 09:10:54 -04:00
Brad King
f7fc93281b Merge topic 'codelite-global-setting'
80574a38 Codelite: Consume the CMAKE_CODELITE_USE_TARGETS setting globally
f59e8779 cmGlobalGenerator: Add API to get settings from top-level cmMakefile
2016-10-07 09:10:52 -04:00
Brad King
fadb812a52 Merge topic 'vs-15-preview-5'
02b7d278 VS: Update VS 15 generator for Preview 5
2016-10-07 09:10:46 -04:00
Brad King
ea563a27a2 Merge topic 'mips-rld-map-rel'
15762b72 elf: Remove GetDynamicEntryCount and ReadBytes methods
cd4f573a cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPath
b8b1d151 cmSystemTools: rewrite RemoveRPath using DyanmicEntryList methods
72eb6a37 elf: add DynamicEntryList methods and rpath tag constants
66c4d082 elf: remove tag switch from ELF_Dyn ByteSwap function
2016-10-07 09:10:43 -04:00
Brad King
fbc1a30b87 Merge branch 'codelite-global-setting' into release 2016-10-07 09:01:30 -04:00
Stephen Kelly
80574a38e6 Codelite: Consume the CMAKE_CODELITE_USE_TARGETS setting globally 2016-10-07 09:01:07 -04:00
Stephen Kelly
0f1fedbd6a CMP0065: Put computed flags into LINK_FLAGS not LINK_LIBRARIES
These flags are redundant anyway in the NEW case of the policy, and
could be merged with CMAKE_EXE_EXPORTS_${lang}_FLAG content for that
case.  That is deferred to the future, but now at least the similar code
is located close to each other.
2016-10-07 08:42:25 -04:00
James Cowgill
15762b72b4 elf: Remove GetDynamicEntryCount and ReadBytes methods
These are no longer used after the DynamicEntryList changes.
2016-10-07 08:30:00 -04:00
James Cowgill
cd4f573ae9 cmSystemTools, elf: handle DT_MIPS_RLD_REL_MAP in RemoveRPath 2016-10-07 08:30:00 -04:00
James Cowgill
b8b1d15186 cmSystemTools: rewrite RemoveRPath using DyanmicEntryList methods 2016-10-07 08:29:59 -04:00
Kitware Robot
8c61544bb7 CMake Nightly Date Stamp 2016-10-07 00:01:16 -04:00
Brad King
02b7d278c8 VS: Update VS 15 generator for Preview 5
The `PlatformToolset` is now `v141` instead of `v140`.

Closes: #16347
2016-10-06 16:46:53 -04:00
Stephen Kelly
7f1cd3280c cmLocalGenerator: Rename local variable to be more appropriate 2016-10-06 22:25:05 +02:00
Stephen Kelly
2597bcf831 cmLocalGenerator: Extract policy handling into a method 2016-10-06 22:17:30 +02:00
Stephen Kelly
20e62f74c5 cmLocalGenerator: Simplify ConvertToLinkReference
Make conversion to output format the caller responsibility, so that the
method only 'converts to a link reference'.
2016-10-06 20:02:10 +02:00
Stephen Kelly
fd93b3605b cmOutputConverter: Add a flag for IsUnix
Remove the need for method parameters to represent the distinction.
2016-10-06 20:02:10 +02:00
Stephen Kelly
1365e18b9b Convert: Inline platform-specific methods
They don't provide real value.
2016-10-06 20:02:09 +02:00
Stephen Kelly
1ed5f6b39b Makefiles: Introduce local RelativePath method
This makes it easier to remove directory-specific state from
cmOutputConverter where it doesn't belong.  Of course, this just
relocates the problem to the makefiles generator for now, but that's
better than affecting the core.
2016-10-06 20:02:08 +02:00
Stephen Kelly
8377d9e00b Fortran: Inline conversion to relative path
Don't use cmOutputConverter method which relies on directory-specific
state.
2016-10-06 20:02:08 +02:00
Stephen Kelly
00173b71d9 Fortran: Wrap path convert in a call with a more-suitable name 2016-10-06 20:02:07 +02:00