764 Commits

Author SHA1 Message Date
Robert Maynard
8d1f9e5b85 CUDA: Now pass correct FLAGS when device link cuda executables.
Previously we had a two issues when building cuda executables
that required separable compilation. The first was that we didn't
propagate FLAGS causing any -arch / -gencode flags to be dropped, and
secondly generators such as ninja would use the CXX language flags
instead of CUDA when the executable was mixed language.
2017-01-12 15:13:36 -05:00
Brad King
ae1a6815b6 Features: Add infrastructure for C++ 17 language standard
Issue: #16468
2016-12-02 11:22:46 -05:00
Brad King
4838ca14df Merge topic 'initial_cuda_language_support'
4cc601f2 Help: Add release note for CUDA support
7b9131da CUDA: Add tests to verify CUDA compiler works properly.
9cf5b98d CUDA: Prefer environment variables CUDACXX and CUDAHOSTCXX.
a5e806b3 CUDA: Add support for CMAKE_CUDA_COMPILE_OPTIONS_VISIBILITY
d038559e CUDA: Add separable compilation support to the makefile generator.
43ce4414 CUDA: Add separable compilation support to the ninja generator.
4b316097 CUDA: Add support for the CUDA_SEPARABLE_COMPILATION target property
ae05fcc6 CUDA: Add LinkLineComputer that computes cuda dlink lines.
115269a8 CUDA: Refactor cmLinkLineComputer to allow for better derived children.
5dec4031 CUDA: Refactor CMakeCUDAInformation to prepare for separable compilation.
5b20d0ab CUDA: C++ compile features now enable cuda c++11 support.
489c52ce CUDA: Use the host compiler for linking CUDA executables and shared libs.
bbaf2434 CUDA: add support for specifying an explicit host compiler.
a92f8d96 CUDA: Enable header dependency scanning.
ec6ce623 CUDA: State that cuda has preprocessor output and can generate assembly.
4f5155f6 CUDA: We now properly perform CUDA compiler identification.
...
2016-11-29 08:59:03 -05:00
Sylvain Joubert
ae4cfa8b12 Remove CTestTestfile.cmake when BUILD_TESTING is OFF
When disabling BUILD_TESTING after a previous configure, the
`CTestTestfile.cmake` was left unchanged.  As a result, ctest would see
the tests while the user disabled testing.  Now when BUILD_TESTING is
OFF any existing `CTestTestfile.cmake` is removed ensuring an empty test
list.
2016-11-15 10:08:12 -05:00
Robert Maynard
489c52ce68 CUDA: Use the host compiler for linking CUDA executables and shared libs. 2016-11-14 11:36:44 -05:00
Robert Maynard
ce4ec876ce CUDA: Add support language levels (98/11) 2016-11-14 11:36:43 -05:00
Brad King
de53eb18ab Merge topic 'import-librhash'
cd8a57ae Add option to build CMake against a system librhash
71180fc8 FindLibRHash: Add module to find the librhash package
3216e94c Remove unused cm_sha2 infrastructure
5420278d Port hash computation to cmCryptoHash
9a596b33 cmCryptoHash: Re-implement in terms of librhash
47f91a61 cmCryptoHash: Avoid using subclasses at client sites
d0ff3e70 librhash: Port to KWIML for ABI and integer type information
465a85fb librhash: Avoid signed left-shift overflow
fc2cb74f librhash: Implement bswap_32 as a function even in strict C90 mode
0bd333bc librhash: Implement bswap_64 even in strict C90 mode
7189d62c librhash: Use __builtin_bswap{32,64} on Clang
af7ebf8a librhash: Install COPYING file with CMake documentation
bb01f20e librhash: Disable warnings to avoid changing 3rd party code
31bb727f librhash: Build the library within CMake
53048afa librhash: Remove source fragments not needed for CMake
5cb1b345 Merge branch 'upstream-librhash' into import-librhash
...
2016-11-10 08:34:28 -05:00
Brad King
5420278dc8 Port hash computation to cmCryptoHash
Avoid using KWSys MD5 or `cm_sha2` and use the `cmCryptoHash`
abstraction instead.
2016-11-10 08:29:38 -05:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Stephen Kelly
e0a84904eb cmState: Split auxiliary classes into separate files
Port dependents to the new locations as needed.

Leave behind a cmState.h include in cmListFileCache to reduce noise. It
is removed in a following commit.
2016-10-19 15:40:59 +02:00
Stephen Kelly
cde6eb6249 cmState: Port dependent code to new cmStateSnapshot name 2016-10-19 15:40:59 +02:00
Stephen Kelly
a49751fb2e cmState: Move TargetType enum to separate namespace 2016-10-19 15:40:58 +02: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
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
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
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
Stephen Kelly
3d0e95f64c cmLocalGenerator: Extract definition retrieval out of loop 2016-10-10 10:09:54 -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
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
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
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00