Commit Graph

28868 Commits

Author SHA1 Message Date
Kitware Robot c8fdc54a3b CMake Nightly Date Stamp 2020-05-20 00:01:14 -04:00
Brad King 2f3a356ea8 Merge topic 'src-named-for-config'
70c85c1d6f Tests: Add case for source files named with CONFIG genex
3b547e2e4b VS: Simplify logic adding source file C/C++ language flag to MSVC
27ead9d4b7 VS: Compute managed type from an existing configuration
1222327c89 VS: Write custom commands for sources from all configurations
65fe58a4b4 cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructure
3fa3b7a402 cmGeneratorTarget: Remove default config from Get* methods
d6a88d2158 cmTarget: Replace "perConfig" constructor boolean with enum

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4761
2020-05-19 09:56:48 -04:00
Brad King e14894c4f7 Merge topic 'simplify_cmPropertyDefinitionMap'
6728f0fa85 cmPropertyDefinitionMap: simplify and shorten

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4753
2020-05-19 09:54:39 -04:00
Brad King 80e93984c7 Merge topic 'add_test-special-chars-in-name'
f84af8e270 add_test: Allow special characters in test name

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4754
2020-05-19 09:48:38 -04:00
Kitware Robot cc79253fa4 CMake Nightly Date Stamp 2020-05-19 00:01:13 -04:00
Brad King 3b547e2e4b VS: Simplify logic adding source file C/C++ language flag to MSVC
Do not add a target-wide language flag.  We need a flag on an individual
source file to explicitly specify the C or C++ language if and only if
the source file extension does not imply it.
2020-05-18 15:34:17 -04:00
Brad King 27ead9d4b7 VS: Compute managed type from an existing configuration
It is not clear how multiple configurations should be handled here, but
using an existing configuration is at least better than the empty
configuration.
2020-05-18 15:34:15 -04:00
Brad King 1222327c89 VS: Write custom commands for sources from all configurations 2020-05-18 15:33:16 -04:00
Brad King 65fe58a4b4 cmVisualStudio10TargetGenerator: Adopt Windows Store and Phone infrastructure
Move support for Resx, Xaml, Certificate, and AppManifest file handling
out of cmGeneratorTarget.
2020-05-18 12:56:56 -04:00
Brad King 3fa3b7a402 cmGeneratorTarget: Remove default config from Get* methods
Ensure all call sites pass an explicit configuration.
2020-05-18 12:56:56 -04:00
Brad King d6a88d2158 cmTarget: Replace "perConfig" constructor boolean with enum 2020-05-18 12:56:55 -04:00
Brad King b246dee7db Merge topic 'cuda-clang'
a653ca9504 Tests: Update CUDA tests to work with Clang
5df21adf46 CUDA: Add support for Clang compiler
dc2eae1f91 FindCUDAToolkit: Factor out discovery code into a separate file
70be10cbf4 CUDA: Remove toolkit include dirs from implicit include dirs only with NVIDIA

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Artem Belevich <tra@google.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Acked-by: Axel Huebl <axel.huebl@plasma.ninja>
Acked-by: friendnick <ikoval67@gmail.com>
Acked-by: Patrik Huber <patrikhuber@gmail.com>
Merge-request: !4442
2020-05-18 12:29:44 -04:00
Brad King ab0a092e13 Merge topic 'fix-ClearSourcesCache'
a9f4f58f0c cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCache

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4751
2020-05-18 12:23:41 -04:00
Brad King ca699e9d69 Merge topic 'fix-CheckTargetsForMissingSources'
25995b2b30 cmGlobalGenerator: Fix CheckTargetsForMissingSources after refactoring

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4747
2020-05-18 12:20:50 -04:00
Kitware Robot 6c4bfb6e7f CMake Nightly Date Stamp 2020-05-18 00:01:10 -04:00
Deniz Bahadir f84af8e270 add_test: Allow special characters in test name
Fixes: #19391
2020-05-17 10:53:14 +02:00
Kitware Robot deffd54250 CMake Nightly Date Stamp 2020-05-17 00:01:11 -04:00
Kitware Robot 135b5835a4 CMake Nightly Date Stamp 2020-05-16 00:01:17 -04:00
Raul Tambre 5df21adf46 CUDA: Add support for Clang compiler
When crosscompiling we pass the sysroot.

We need to try various architecture flags. Clang doesn't automatically
select one that works.  First try the ones that are more likely to work
for modern installations:

* <=sm_50 is deprecated since CUDA 10.2, try sm_52 first for
          future compatibility.
* <=sm_20 is removed since CUDA 9.0, try sm_30.

Otherwise fallback to Clang's current default. Currently that's `sm_20`,
the lowest it supports.

Separable compilation isn't supported yet.

Fixes: #16586
2020-05-15 17:46:51 +03:00
Brad King eb93b50be9 Merge topic 'source_file_scopes'
3d4b70ea64 set_source_files_properties: Allow specification of directory scope

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4661
2020-05-15 09:58:03 -04:00
Tushar Maheshwari 6728f0fa85 cmPropertyDefinitionMap: simplify and shorten 2020-05-15 18:58:02 +05:30
Brad King a9f4f58f0c cmGeneratorTarget: Clear AllConfigSources in ClearSourcesCache
In commit 40aa6c059c (cmGeneratorTarget: Add method to collect all
sources for all configs, 2017-04-10, v3.9.0-rc1~268^2~5) we forgot to
update `ClearSourcesCache` to also clear `AllConfigSources`.  This leads
to subtle cases where code paths like PCH handling that add sources
during generation break depending on ordering.

Suggested-by: Christian Fersch
Fixes: #20712, #20702
2020-05-15 08:26:43 -04:00
Brad King 25995b2b30 cmGlobalGenerator: Fix CheckTargetsForMissingSources after refactoring
Refactoring in commit 01b2d6ab74 (Modernize: Use ranged for-loops when
possible, 2019-02-07, v3.15.0-rc1~575^2) accidentally changed a loop
condition in this method from "keep iterating if srcs.empty()" to
"stop iterating if srcs.empty()".  Switch it back.

The bug could only manifest in very subtle conditions in a multi-config
generator.  Add one such case to the test suite.

Fixes: #20706
2020-05-15 05:39:25 -04:00
Kitware Robot 5208b8c853 CMake Nightly Date Stamp 2020-05-15 00:01:17 -04:00
Alexandru Croitor 3d4b70ea64 set_source_files_properties: Allow specification of directory scope
Both set_source_files_properties() and set_property(SOURCE) now accept
two new optional arguments: DIRECTORY and TARGET_DIRECTORY.

The DIRECTORY option takes a list of relative or absolute paths
pointing to processed source directories (add_subdirectory was
already called on them).

These paths specify directory scopes where the source file properties
will be set. Previously the scope was always the currently processed
source directory.

Similarly TARGET_DIRECTORY takes a list of targets, whose source
directories will be used as the list of scopes where to set the
source file properties.

get_property() and get_source_file_property() also get the same
new arguments, except only one value can be specified instead
of a list.

Fixes: #20128
2020-05-14 16:31:22 +02:00
Brad King 4d9ef146f4 Merge topic 'update-kwsys'
833ae0a63b Merge branch 'upstream-KWSys' into update-kwsys
3674f6a470 KWSys 2020-05-13 (d4da6980)

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4743
2020-05-14 08:07:39 -04:00
Brad King 73be779091 Merge topic 'cmake_command_preserve_args'
549599bf32 cmake_command: Preserve arguments to INVOKE function

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4741
2020-05-14 07:54:11 -04:00
Kitware Robot 1777ee9084 CMake Nightly Date Stamp 2020-05-14 00:01:11 -04:00
Brad King 3a82b3f534 Merge topic 'interface-sources-multi-config'
6c5d4522bc INTERFACE_SOURCES: Fix per-config link libs on multi-config generators
8daa140c6a cmGeneratorTarget: Factor evaluated target prop entries into struct
fcd1a1a920 cmGeneratorTarget: Track when the set of link libs is config-dependent

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4740
2020-05-13 12:14:09 -04:00
Brad King 833ae0a63b Merge branch 'upstream-KWSys' into update-kwsys
# By KWSys Upstream
* upstream-KWSys:
  KWSys 2020-05-13 (d4da6980)
2020-05-13 07:08:22 -04:00
Kitware Robot ad11526dc4 CMake Nightly Date Stamp 2020-05-13 00:01:10 -04:00
Cristian Adam 549599bf32 cmake_command: Preserve arguments to INVOKE function
Fixes: #20630
2020-05-12 22:25:29 +02:00
Brad King 6c5d4522bc INTERFACE_SOURCES: Fix per-config link libs on multi-config generators
In multi-config generators we memoize the computed set of source files
for a target to avoid repeating the computation when the set does not
depend on the configuration.  We already track whether generator
expressions in `SOURCES` or `INTERFACE_SOURCES` reference the
configuration (`$<CONFIG:...>`).  However, we previously forgot to track
whether the set of libraries whose `INTERFACE_SOURCES` are considered
depends on the configuration.  This caused multi-config generators to
use the first configuration's set of sources for all configurations
in cases such as

    target_link_libraries(tgt PRIVATE $<$<CONFIG:Debug>:iface_debug>)

where the `iface_debug` target has `INTERFACE_SOURCES`.

Fix this by also tracking config-dependence of the list of libraries for
evaluation of the list of source files.

Fixes: #20683
2020-05-12 12:44:32 -04:00
Brad King 8daa140c6a cmGeneratorTarget: Factor evaluated target prop entries into struct
This will allow storing more than just the list of entries itself.
2020-05-12 12:37:27 -04:00
Brad King fcd1a1a920 cmGeneratorTarget: Track when the set of link libs is config-dependent
Report in `cmLinkImplementationLibraries` and `cmLinkInterfaceLibraries`
whether the list of libraries depends on a genex referencing the
configuration.  We already track whether a genex references the head
target.
2020-05-12 12:37:13 -04:00
Brad King 1fb0cb1dd3 Merge topic 'refactor_cmSetPropertiesCommands'
300bf4e94f set_*_properties: simplify and shorten implementations

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4728
2020-05-12 07:00:15 -04:00
Tushar Maheshwari 300bf4e94f set_*_properties: simplify and shorten implementations
Optimize argument copies and range traversal.
Inline the single use file static functions.
2020-05-12 06:59:00 -04:00
Brad King eb2a554b12 Merge topic 'vs-pch-compile-opts'
6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4734
2020-05-12 06:53:41 -04:00
Kitware Robot 327e79c359 CMake Nightly Date Stamp 2020-05-12 00:01:17 -04:00
Brad King 6b2fb4ffd2 VS: Fix using PCH from source with COMPILE_OPTIONS
If a source file gets per-source flags from both PCH and custom
`COMPILE_OPTIONS`, combine them correctly.

Fixes: #20694, #20456
2020-05-11 11:58:41 -04:00
Brad King d4b1d3d4f0 Merge topic 'source_group_forward_slashes'
faf44a8cdb source_group: Support forward slashes in group hierarchy

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4727
2020-05-11 10:14:24 -04:00
Brad King cee7eb8b3a Merge topic 'unity_explicit_groups'
9f4eb352fe Unity Builds: Support explicit specification of sources to groups
b00585adcc Unity: Refactor implementation to make it easier to extend

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4716
2020-05-11 10:08:12 -04:00
Kitware Robot c2460c0e63 CMake Nightly Date Stamp 2020-05-11 00:01:15 -04:00
Craig Scott faf44a8cdb source_group: Support forward slashes in group hierarchy
Fixes: #18076
2020-05-11 08:15:25 +10:00
Kitware Robot edbbd67461 CMake Nightly Date Stamp 2020-05-10 00:01:10 -04:00
Kitware Robot d59e65ecc0 CMake Nightly Date Stamp 2020-05-09 00:01:18 -04:00
Brad King 171bf5fa92 Merge topic 'third-parties-layout'
2faa3f6c55 Refactoring: Third-parties public headers are under cm3p prefix
75e87e3db4 bootstrap: update list of problematic files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4705
2020-05-08 08:18:17 -04:00
Brad King 195090f9f0 Merge topic 'pch-reuse-multi'
a2ee941aba Merge branch 'backport-pch-reuse-multi' into pch-reuse-multi
605d6c65c9 PCH: Fix REUSE_FROM in multi-config generators
7a1c7736cb PCH: Fix REUSE_FROM in multi-config generators

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4717
2020-05-08 08:03:44 -04:00
Kitware Robot b9350813f3 CMake Nightly Date Stamp 2020-05-08 00:01:13 -04:00
Robert Maynard 9f4eb352fe Unity Builds: Support explicit specification of sources to groups
Instead of having CMake determine which files should go into each
unity file, the user can now use explicitly state the mapping.
2020-05-07 11:13:34 -04:00