Commit Graph

18214 Commits

Author SHA1 Message Date
Thomas Herz 20560e8dca Ninja: Do not use newlines in response files with Windows GNU tools (#15439)
Since commit v2.8.11~213^2 (Ninja: Avoid LNK1170 linker error, 2013-02-01)
we generate linker response files with "$in_newline" to support a large
number of object files with the MS link.exe tool.  However, the GNU linker
on Windows does not understand the newline endings that Ninja puts in the
response files.  Switch back to "$in" for that case.
2015-05-07 14:10:21 -04:00
Thomas Herz b3de0dfe93 Ninja: Use forward slashes for any GCC on Windows (#15439)
Any GCC compiler on a Windows host needs forward slashes, not just
those built for MinGW.
2015-05-07 14:07:20 -04:00
Brad King 378c2a0e86 Ninja: Refactor detection of MinGW tools on Windows
Check for CMAKE_COMPILER_IS_MINGW only after enabling a language when it
might actually be set.  Previously this worked by accident because the
check for working compiler or a second language enabled would cause the
code path to be taken.

Store UsingMinGW as an instance member of cmGlobalNinjaGenerator so that
it is reset on each reconfigure.  Otherwise cmake-gui cannot switch
between build trees for MinGW or non-MinGW tools.
2015-05-07 14:02:44 -04:00
Brad King 957c2aac7f RC: Simplify selection of resource compiler based on C/C++ toolchain
Revert the refactoring by commit v2.8.11~105^2~1 (Ninja: use MinGW
generator code in EnableLanguage, 2013-03-09) and move the MinGW-
specific logic back to the "MinGW Makefiles" generator.  Instead teach
the platform information modules for GNU and MSVC on Windows to set the
preferred RC compiler just before enabling the RC language.  This way
we choose the RC compiler based on the C/C++ toolchain that is actually
enabled.
2015-05-07 11:43:02 -04:00
Kitware Robot b3ae0609db CMake Nightly Date Stamp 2015-05-07 00:01:05 -04:00
Robert Goulet a6e4e73da3 VS: Add option to put INSTALL target in .sln default build
Add a CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD variable to control
this behavior.
2015-05-06 10:31:39 -04:00
Kitware Robot 3bc6f4f476 CMake Nightly Date Stamp 2015-05-06 00:01:06 -04: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
Brad King 82a55ff916 Merge topic 'refactor-cmMakefile-constructor'
42142d4f cmMakefile: Inline Intialize method in constructor
f39f0c0a cmMakefile: Initialize SuppressWatches member before use
2015-05-05 09:35:23 -04:00
Brad King a874700fc2 Merge branch 'upstream-kwsys' into update-kwsys 2015-05-05 09:13:24 -04:00
Brad King f6749f7274 Merge branch 'upstream-kwsys' into update-kwsys 2015-05-05 09:12:21 -04:00
Kitware Robot 9e3181a112 CMake Nightly Date Stamp 2015-05-05 00:01:05 -04:00
Stephen Kelly 013ada80ea cmPolicies: Implement PolicyMap in terms of bitset. 2015-05-04 22:32:21 +02:00
Stephen Kelly be6664c208 cmPolicies: Implement abstraction for PolicyMap.
Hide the detail that it is a std::map.
2015-05-04 22:32:21 +02:00
Stephen Kelly de21168612 Port to static cmPolicies API. 2015-05-04 22:32:20 +02:00
Stephen Kelly 13981f2068 cmPolicies: Make all API static. 2015-05-04 22:32:20 +02:00
Stephen Kelly 23e2bcc8db cmPolicies: Remove unused DefinePolicy method.
Policies are no longer defined at runtime.
2015-05-04 22:32:20 +02:00
Stephen Kelly 5641ba4fca cmPolicies: Remove unused cmPolicy class. 2015-05-04 22:32:20 +02:00
Stephen Kelly 3de5449703 cmPolicies: Loop over all policies using enum constants. 2015-05-04 22:32:19 +02:00
Stephen Kelly 387aff200c cmPolicies: Trivialize GetPolicyStatus method.
It would be possible to implement this with an XMacro and switch
statement, but every codepath currently would still return WARN.
2015-05-04 22:32:19 +02:00
Stephen Kelly dbf680d670 cmPolicies: Use more-direct ID access. 2015-05-04 22:32:19 +02:00
Stephen Kelly 8c204133e5 cmPolicies: Implement in terms of public API. 2015-05-04 22:32:19 +02:00
Stephen Kelly e3a8c0291e cmPolicies: Make private method file-static. 2015-05-04 22:32:19 +02:00
Stephen Kelly cb765af049 cmPolicies: Implement short description access with XMacros. 2015-05-04 22:32:18 +02:00
Stephen Kelly 5df267fa1d cmPolicies: Implement version check with XMacro. 2015-05-04 22:32:18 +02:00
Stephen Kelly 2235cfebee cmPolicies: Implement id to version with XMacro. 2015-05-04 22:32:18 +02:00
Stephen Kelly 05d8438860 cmPolicies: Implement id to string conversion with XMacro. 2015-05-04 22:32:18 +02:00
Stephen Kelly 6eaade8a82 cmPolicies: Introduce XMacro table for policy data.
Use it to populate the policy enum.
2015-05-04 22:32:18 +02:00
Stephen Kelly fdca04db68 cmPolicies: Implement more-compact IsPolicyNewerThan. 2015-05-04 22:32:17 +02:00
Stephen Kelly a7ff972751 cmPolicies: Parse string for id conversion.
Remove now-unused PolicyStringMap.
2015-05-04 22:32:17 +02:00
Brad King d3b36a90b6 Merge topic 'truncate-snapshots'
83dc483e cmState: Truncate snapshot data in Initialize.
2015-05-04 11:02:25 -04:00
Brad King 0d167b3e60 Merge topic 'add-cmMakefile-GetGlobalGenerator'
a0836ed9 Port to cmMakefile::GetGlobalGenerator.
cbf143bb cmComputeTargetDepends: Use simpler global generator access.
040491fc cmComputeLinkDepends: Remove unused local generator.
0bb6dbe0 cmMakefile: Extract an accessor for the global generator.
e1bdf5f5 cmMakefile: Use GetCMakeInstance.
efcca935 cmMakefile: Simplify GetCMakeInstance implementation.
2015-05-04 11:02:23 -04:00
Brad King 1ef88dcd46 Merge topic 'refactor-cmDefinitions-Get'
6c7dad41 cmDefinitions: Make Get method static.
a7ce0c7b cmDefinitions: Make GetInternal method static.
7a5039fa cmDefinitions: Use static member without this->.
191573f7 cmDefinitions: Remove Parent pointer.
8b1745a1 cmDefinitions: Accept varStack iterators in Get API.
2015-05-04 11:02:21 -04:00
Brad King 8403c8da2c Merge topic 'mingw32-make-backslash-workaround'
bb6663ca Makefile: Workaround mingw32-make trailing backslash trouble (#15546)
2015-05-04 11:02:18 -04:00
Brad King 42142d4fd2 cmMakefile: Inline Intialize method in constructor
Since commit 80909041 (cmMakefile: Disable copy constructor, 2015-04-18)
the only call to cmMakefile::Initialize is in one constructor.  Inline
it and drop the separate method.
2015-05-04 10:22:01 -04:00
Brad King f39f0c0aec cmMakefile: Initialize SuppressWatches member before use
In commit 86f3cd0f (cmMakefile: Require the localGenerator in the
constructor, 2015-04-27) we added use of GetDefinition to the
Initialize method.  Set SuppressWatches before calling this method
since GetDefinition checks it.
2015-05-04 10:22:01 -04:00
Kitware Robot e0222dda14 CMake Nightly Date Stamp 2015-05-04 00:01:06 -04:00
Stephen Kelly 83dc483e4e cmState: Truncate snapshot data in Initialize.
When Configure is executed multiple times with the same cmake
instance (either using CTest --two-config or a interactive gui), the
location and structural data was preserved though it would not be used
again.  Fix that by clearing the data in a method called early in
the configure step.
2015-05-03 20:36:29 +02:00
Stephen Kelly a0836ed978 Port to cmMakefile::GetGlobalGenerator. 2015-05-03 11:42:00 +02:00
Stephen Kelly cbf143bb76 cmComputeTargetDepends: Use simpler global generator access. 2015-05-03 11:41:59 +02:00
Stephen Kelly 040491fc58 cmComputeLinkDepends: Remove unused local generator. 2015-05-03 11:41:59 +02:00
Stephen Kelly 0bb6dbe0c6 cmMakefile: Extract an accessor for the global generator.
Both for convenience, and because cmMakefile should not be the
way to get access to the local generator, so that should go away
in the future.
2015-05-03 11:41:59 +02:00
Stephen Kelly e1bdf5f5b2 cmMakefile: Use GetCMakeInstance. 2015-05-03 11:41:59 +02:00
Stephen Kelly efcca9353f cmMakefile: Simplify GetCMakeInstance implementation.
No callers handle the possibility that it can return null, and that
is no longer possible anyway.
2015-05-03 11:05:27 +02:00
Stephen Kelly 953d1b00af cmPolicies: Make private method file-static. 2015-05-03 10:09:10 +02:00
Stephen Kelly 2c10494ab3 cmPolicies: Remove runtime check for programming errors. 2015-05-03 10:08:50 +02:00
Stephen Kelly 48f9fd39ad cmPolicies: Remove unused forward declaration. 2015-05-03 10:08:35 +02:00
Stephen Kelly fd0aa7434b cmPolicies: Remove unused static data. 2015-05-03 10:08:04 +02:00
Stephen Kelly a3291fe8ec cmPolicies: Remove unused header. 2015-05-03 10:07:58 +02:00
Stephen Kelly a6fb6db49d cmPolicies: Fix values for policies 57-60. 2015-05-03 10:07:48 +02:00
Kitware Robot 6cd6d50871 CMake Nightly Date Stamp 2015-05-03 00:01:08 -04:00
Kitware Robot 22a707e861 CMake Nightly Date Stamp 2015-05-02 00:01:06 -04:00
Stephen Kelly 6c7dad41d9 cmDefinitions: Make Get method static. 2015-05-01 19:45:05 +02:00
Stephen Kelly a7ce0c7bc0 cmDefinitions: Make GetInternal method static.
For some reason, using recursion here is faster to configure ParaView
than using a loop.  Probably some compiler optimization is inhibited
by using a loop.

Co-Author: Brad King <brad.king@kitware.com>
2015-05-01 19:44:35 +02:00
Stephen Kelly 7a5039fa6c cmDefinitions: Use static member without this->. 2015-05-01 19:36:03 +02:00
Stephen Kelly 191573f792 cmDefinitions: Remove Parent pointer.
All structural knowledge of the stack of scopes is now external.
2015-05-01 19:34:59 +02:00
Stephen Kelly 8b1745a1c5 cmDefinitions: Accept varStack iterators in Get API. 2015-05-01 19:34:59 +02:00
Brad King 514640411a Merge topic 'refactor-RaiseScope'
e8ae46e5 cmMakefile: Implement RaiseScope without relying on Parent.
30a021cc cmMakefile: Implement RaiseScope in terms of local Get method.
2015-05-01 13:16:16 -04:00
Brad King a588d1ee99 Merge topic 'fix-cmState-try_compile-languages'
27343e3b cmGlobalGenerator: Finish storing enabled languages in cmState
2015-05-01 13:16:12 -04:00
Brad King c1081a45d5 Merge topic 'cmComputeLinkInformation-minor-cleanup'
faede40b cmComputeLinkInformation: Reduce 'if' nesting in AddItem
2015-05-01 13:16:09 -04:00
Brad King bb6663ca0a Makefile: Workaround mingw32-make trailing backslash trouble (#15546)
When given the command line

  tool a\ b c

mingw32-make incorrectly passes "a b" and "c" to the tool.  When given
the command line

  tool a\ b "c"

mingw32-make correctly passes "a\", "b", and "c" to the tool.

Since commit v3.1.0-rc1~861^2 (MSVC: Add properties to configure
compiler PDB files, 2014-02-24) we pass the compiler pdb option to
MS-style compiler tools as "/Fd<dir>\" but mingw32-make may consume
the backslash as escaping a following space as described above.
Workaround this problem by changing the backslash to a forward
slash as had been used prior to the above commit.
2015-05-01 08:23:22 -04:00
Kitware Robot 59edc038d5 CMake Nightly Date Stamp 2015-05-01 00:01:05 -04:00
Stephen Kelly e8ae46e5e2 cmMakefile: Implement RaiseScope without relying on Parent. 2015-04-30 23:45:06 +02:00
Stephen Kelly 30a021cc22 cmMakefile: Implement RaiseScope in terms of local Get method.
The cmDefinitions::Get will change behavior in follow up commits.
2015-04-30 23:34:01 +02:00
Brad King 5e35d4a67f Merge topic 'refactor-cmDefinitions'
b48ea26a cmDefinitions: Invert conditional code.
5ccff640 cmDefinitions: Externalize looping for ClosureKeys.
f79cd99d cmDefinitions: Implement MakeClosure in terms of reverse iterators.
aa4d1ee8 cmDefinitions: Convert MakeClosure into a static method.
60becdc6 cmDefinitions: Implement MakeClosure in terms of a list of ancestors.
d858f363 cmDefinitions: Use list of cmDefinitions* to create closure.
aaaa65b6 cmMakefile: Remove stack adaptor for the VarStack.
f983d891 cmDefinitions: Replace recursion with loop.
24885d4e cmDefinitions: Replace private constructor with MakeClosure.
012a75a0 cmDefinitions: Make ClosureKeys API vector-based.
ca9fa77d cmDefinitions: Inline GetClosureKeys implementation.
78e1454e cmDefinitions: Replace ClosureKeys recursion with looping.
818bf727 cmDefinitions: Change LocalKeys to return a vector.
5067ae41 cmDefinitions: Externalize the Set logic.
60200ca5 cmDefinitions: Add an Erase method.
b43c162e cmMakefile: Use the Internal class to enclose the VarStack.
2015-04-30 11:19:20 -04:00
Brad King 735b7092e8 Merge topic 'if-IN_LIST'
aed6239e if: Implement new IN_LIST operator
2015-04-30 10:32:03 -04:00
Brad King b39929ab42 Merge topic 'revert-CMP0057'
32a2f414 Revert "add_custom_command: Diagnose MAIN_DEPENDENCY limitation."
2015-04-30 10:32:01 -04:00
Nils Gladitz aed6239e40 if: Implement new IN_LIST operator 2015-04-30 10:21:19 -04:00
Nils Gladitz 32a2f41402 Revert "add_custom_command: Diagnose MAIN_DEPENDENCY limitation."
This reverts commit 242c3966 (add_custom_command: Diagnose
MAIN_DEPENDENCY limitation, 2015-03-09) and the follow up commit
b372a99a (UseSWIG: Do not use MAIN_DEPENDENCY on custom commands,
2015-03-26).

I misdiagnosed the underlying issue that prompted creation of policy CMP0057.
The actual issue surfaces when a single custom command's MAIN_DEPENDENCY
is listed in more than one target; this issue will have to be addressed
independently.
2015-04-30 10:20:20 -04:00
Brad King 27343e3b68 cmGlobalGenerator: Finish storing enabled languages in cmState
In commit 74de9a73 (cmGlobalGenerator: Delegate storage of enabled
languages to cmState, 2015-04-11) the original LanguageEnabled
member of cmGlobalGenerator was left behind by mistake.  One use
of it in EnableLanguagesFromGenerator (for try_compile) was left,
but the member is not populated anymore.  Drop the member and
teach EnableLanguagesFromGenerator to copy the list of enabled
languages from one cmState to the other.

Reported-by: Matt McCormick <matt.mccormick@kitware.com>
2015-04-30 09:08:25 -04:00
Kitware Robot 0060e159fb CMake Nightly Date Stamp 2015-04-30 00:01:06 -04:00
Stephen Kelly b48ea26a9d cmDefinitions: Invert conditional code.
Return the simple case first.
2015-04-30 00:32:48 +02:00
Stephen Kelly 5ccff6408c cmDefinitions: Externalize looping for ClosureKeys. 2015-04-30 00:32:18 +02:00
Stephen Kelly f79cd99d6d cmDefinitions: Implement MakeClosure in terms of reverse iterators.
Iterate directly over the parent content provided by cmMakefile.
2015-04-29 23:54:20 +02:00
Stephen Kelly aa4d1ee80f cmDefinitions: Convert MakeClosure into a static method.
Accept a range of cmDefinitions*.
2015-04-29 23:54:17 +02:00
Stephen Kelly 60becdc65c cmDefinitions: Implement MakeClosure in terms of a list of ancestors. 2015-04-29 23:54:02 +02:00
Stephen Kelly d858f36339 cmDefinitions: Use list of cmDefinitions* to create closure. 2015-04-29 23:38:44 +02:00
Stephen Kelly aaaa65b6a5 cmMakefile: Remove stack adaptor for the VarStack.
The purpose of the stack is to allow access only to the top of it.  Access
to items which are not at the top is needed, so cmDefinitions objects
get a Parent pointer.

The existence of the Parent pointer is a workaround for the inappropriate
use of stack in the first place.  Remove it now.
2015-04-29 22:51:47 +02:00
Stephen Kelly f983d8913b cmDefinitions: Replace recursion with loop. 2015-04-29 22:51:46 +02:00
Stephen Kelly 24885d4efa cmDefinitions: Replace private constructor with MakeClosure. 2015-04-29 22:51:46 +02:00
Stephen Kelly 012a75a00f cmDefinitions: Make ClosureKeys API vector-based.
Construct the final list directly in a named return value.  Use
a single set to track bindings already found.

Co-Author: Brad King <brad.king@kitware.com>
2015-04-29 22:51:28 +02:00
Stephen Kelly ca9fa77d5d cmDefinitions: Inline GetClosureKeys implementation. 2015-04-29 22:49:05 +02:00
Stephen Kelly 78e1454ea0 cmDefinitions: Replace ClosureKeys recursion with looping. 2015-04-29 22:49:05 +02:00
Stephen Kelly 818bf727c1 cmDefinitions: Change LocalKeys to return a vector.
This is more efficient and we lose nothing.
2015-04-29 22:49:05 +02:00
Stephen Kelly 5067ae41b0 cmDefinitions: Externalize the Set logic. 2015-04-29 22:48:56 +02:00
Stephen Kelly 60200ca508 cmDefinitions: Add an Erase method. 2015-04-29 22:48:12 +02:00
Stephen Kelly b43c162e99 cmMakefile: Use the Internal class to enclose the VarStack.
Put knowledge of the implementation details in one place.
2015-04-29 22:48:12 +02:00
Brad King 036e449c66 Merge topic 'clean-up-cmDefinitions'
a3358fac cmDefinitions: Inline SetInternal method.
23370344 cmDefinitions: Remove unused Set return value.
b9f4dd39 cmDefinitions: Remove unused method.
2015-04-29 11:11:46 -04:00
Brad King 72e380fb12 Merge topic 'cmState-CurrentDirs'
46f6a5f4 cmState: Store the Current directories.
3a041c59 Introduce cmState::Snapshot.
ae6c8a9d cmState: Store the Source and Binary directories.
86f3cd0f cmMakefile: Require the localGenerator in the constructor.
a48aebcb cmLocalGenerator: Require a parent in the constructor.
e4c78b37 cmMakefile: Inline SetHome* methods into last remaining caller.
410f39a4 cmMakefile: Delegate storage of Home dirs to the cmake class.
2015-04-29 11:11:42 -04:00
Kitware Robot d1a74bba1b CMake Nightly Date Stamp 2015-04-29 00:01:05 -04:00
Stephen Kelly a3358faca1 cmDefinitions: Inline SetInternal method. 2015-04-29 00:18:13 +02:00
Stephen Kelly 2337034442 cmDefinitions: Remove unused Set return value. 2015-04-29 00:18:13 +02:00
Stephen Kelly b9f4dd39bb cmDefinitions: Remove unused method. 2015-04-29 00:17:38 +02:00
Brad King 9de73d7ee5 Merge topic 'include-early-optional-handling'
8d9f39f4 include: Ask for permission, rather than forgiveness.
2015-04-28 13:55:55 -04:00
Brad King c0989eaf2a Merge topic 'fix-osx-framework-detection'
c46490da cmSystemTools: Fix IsPathToFramework implementation (#15535)
2015-04-28 13:55:54 -04:00
Stephen Kelly 46f6a5f458 cmState: Store the Current directories. 2015-04-28 07:57:21 +02:00
Stephen Kelly 3a041c5949 Introduce cmState::Snapshot.
Create snapshots for buildsystem directories during configure time.

This class will be extended in follow up commits to snapshot
all values in the cmState.
2015-04-28 07:57:01 +02:00
Stephen Kelly ae6c8a9d68 cmState: Store the Source and Binary directories. 2015-04-28 07:50:57 +02:00
Stephen Kelly 86f3cd0f7e cmMakefile: Require the localGenerator in the constructor.
Move the contents of cmMakeile::SetLocalGenerator to the Initialize
method.
2015-04-28 07:50:57 +02:00
Stephen Kelly a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00