5804 Commits

Author SHA1 Message Date
Brad King
f082414107 Merge topic 'vs-2015-max-sdk'
63eb43f131 Tests: Add VSWinStorePhone for VS 15 2017
173d29a379 Tests: Fix VSWinStorePhone to properly identify VS 14 2015
83ddc4d289 VS: Do not select a Windows SDK too high for current VS version

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2388
2018-09-20 09:33:05 -04:00
Brad King
a9df54ec31 Merge topic 'symlink'
afb7f6e4ff cmake: Add '-E create_symlink' support on Windows

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2144
2018-09-19 10:41:07 -04:00
Brad King
ec9ef691fe Merge topic 'provide_explicit_source_and_build_command_line_options'
638f00117a Add release note for the -S and -B options.
de962cc00d CMake: Internally uses -S instead of -H to specify source directory
a10d63d578 cmake: -S and -B can be used to specify source and build directories

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2358
2018-09-19 10:38:19 -04:00
Brad King
c0cedaa643 Merge topic 'ctest-more_submit_params'
7f530cc54e ctest_submit: pass additional info to CDash

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2380
2018-09-19 10:36:11 -04:00
Brad King
76a19eb6c1 Merge topic 'fix-getsafedef-stdstring'
2428422c02 Fix regression in target output file naming logic
d686f81e58 Restore possibly regressed CMP0018 logic

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2402
2018-09-19 10:33:01 -04:00
Gilles Khouzam
63eb43f131 Tests: Add VSWinStorePhone for VS 15 2017
VS 2017 needs several components installed to support this test, so
enable it only via an explicit option that can be set on specific
builders.
2018-09-19 09:40:17 -04:00
Gilles Khouzam
173d29a379 Tests: Fix VSWinStorePhone to properly identify VS 14 2015
VS 14 2015 was only identified by the Windows 10 SDK. On machines with
only VS 2017 and the Windows 10 SDKs, this would incorrectly identify
that VS 2015 was installed.  Check for VS 14 2015 with its proper
registry entry.
2018-09-19 09:39:25 -04:00
Brad King
2428422c02 Fix regression in target output file naming logic
Refactoring in commit f4ff60a803 (cmMakefile: Make GetSafeDefinition
return std::string const&, 2018-09-05) accidentally changed the logic
for target artifact prefix and suffix names such that setting a PREFIX
or SUFFIX target property would cause an empty value to be used.  Revert
that part of the change and use a simpler alternative.  Add a test case.

Reported-by: Alan W. Irwin <irwin@beluga.phys.uvic.ca>
2018-09-19 08:14:48 -04:00
Jon Chronopoulos
afb7f6e4ff cmake: Add '-E create_symlink' support on Windows
The allows `-E create_symlink` to work on Windows.  It utilizes
`uv_fs_symlink`.  I am still unsure exactly which Windows platforms will
work without requiring Administrator privileges or needing a user/group
with the "Create Symbolic Links" User Rights.  It does work with my
Windows 10 Pro with Developer Mode turned on.  In the test suite check
that the symlink either worked or failed with a permissions error.

Use recent changes in cmSystemTools::FileExists to check that a symlink
is broken.
2018-09-18 11:24:08 -04:00
Brad King
7162630bee Merge topic 'vs-ipo'
bef80e6623 VS: Do not specify incremental linking if LTCG is enabled
567fabe88e IPO: INTERPROCEDURAL_OPTIMIZATION (LTCG) for Visual Studio

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2363
2018-09-18 11:22:41 -04:00
Niels Dekker
567fabe88e IPO: INTERPROCEDURAL_OPTIMIZATION (LTCG) for Visual Studio
Add IPO support for Visual Studio (which is referred to by VS as
"Link Time Code Generation" and "Whole Program Optimization"), for
VS version >= 10.  This allows CMake/VS users to enable IPO by setting
property `INTERPROCEDURAL_OPTIMIZATION`.

Fixes: #16748
2018-09-17 10:53:10 -04:00
Zack Galbreath
7f530cc54e ctest_submit: pass additional info to CDash
Specify buildname, site, and buildstamp to CDash upon submission.
CDash will use this extra info to assign and report back a buildid.
2018-09-17 10:38:33 -04:00
Brad King
2af106a43a Merge topic 'link-options'
6da8b67c3f target_link_options: fix erroneous handling of BEFORE keyword.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2384
2018-09-17 09:25:40 -04:00
Robert Maynard
a10d63d578 cmake: -S and -B can be used to specify source and build directories
Document the previously internal option of '-B' and provide a
matching source directory option with '-S'. Both '-B', and '-S'
can be used independently of each other.
2018-09-15 11:25:47 -04:00
Brad King
333804fa0e Merge topic 'out-of-dir-linking'
a1ad0a699b target_link_libraries: Allow use with targets in other directories
9bbae5ae28 cmTarget: Future-proof AddLinkLibrary target lookup scope
f9cb6f618a cmExportFileGenerator: Use cmGeneratorTarget::ResolveTargetReference
18441a6269 cmGeneratorTarget: Factor target name resolution out of link item resolution
2f708f5d65 Make internal TARGET_PROPERTY generator expressions more robust
94a75801c8 Android.mk: De-duplicate link libraries logic during export
8a63b23d16 cmGlobalGenerator: Remove unused FindLocalGenerator method

Acked-by: Kitware Robot <kwrobot@kitware.com>
Reviewed-by: Patrick Stotko <stotko@cs.uni-bonn.de>
Merge-request: !2370
2018-09-14 13:25:07 -04:00
Marc Chevrier
6da8b67c3f target_link_options: fix erroneous handling of BEFORE keyword. 2018-09-14 18:10:58 +02:00
Brad King
a1ad0a699b target_link_libraries: Allow use with targets in other directories
Previously the command did not allow naming targets on the LHS that
were not created in the calling directory.  Lift this restriction to
enable more flexible use by projects.

Targets named on the RHS will need to be looked up during generation in
the scope of the call site rather than the scope of the LHS target.
Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties
to specify target names that need to be looked up in a directory other
than that containing the target on which the property is set.  Add
minimal documentation of the syntax to help users that encounter it.

Unfortunately CMake previously did allow such calls in the case that
only `INTERFACE` libraries are specified, but those libraries would be
looked up in the target's directory rather than the caller's.  Add
policy `CMP0079` to enable the new behavior with new lookup scope in a
compatible way.

Fixes: #17943
2018-09-12 13:06:36 -04:00
Brad King
bdd0e2d709 Tests: Extend RunCMake.Ninja filesystem delays
On filesystems with 1s resolution the `run_sub_cmake` cases fail
occasionally when the 1 second sleep does not cause files to have
a different time.  Use 3 seconds instead.
2018-09-12 10:22:22 -04:00
Craig Scott
344eb9c8dc Merge topic 'gtest_add_tests-empty-file'
31c82143bf GoogleTest: gtest_add_tests() fails if any source file is empty
d6b06d8d87 GoogleTest: Modify test to verify that empty files can be scanned

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2342
2018-09-11 09:42:31 -04:00
Brad King
b1c8d95dbe Merge topic 'imported-same-name'
f35be59961 Fix transitive usage requirements through same-name imported targets
1b57f49586 genex: Simplify cmGeneratorExpressionInterpreter
bea390e9bd Fix dependency propagation through same-name imported targets
fc7e4d1ed8 cmLinkItem: Convert to a "sum type" over a string and target pointer

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2359
2018-09-11 08:20:50 -04:00
Brad King
bb59e362cc Merge topic 'fix-ctest_start-track'
09f0325eaf CTest: Fix regression in ctest_start()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2366
2018-09-11 08:18:08 -04:00
Brad King
c669b59095 Merge topic 'ctest-fix-test-load'
292ec157b6 CTest: Fix --test-load regression

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2362
2018-09-11 08:12:09 -04:00
Kyle Edwards
09f0325eaf CTest: Fix regression in ctest_start()
The format for the TAG file was changed in 3.12, and the way it was
read caused a regression which changed how the track was decided. This
commit fixes the regression.

Fixes #18347.
2018-09-10 14:31:21 -04:00
Brad King
f35be59961 Fix transitive usage requirements through same-name imported targets
If two imported targets in different directories have the same name we
should still be able to propagate transitive usage requirements from
both.  Fix the DAG checker to work with target pointers instead of
target names since the pointers will not be duplicated even if the names
are.

Fixes: #18345
2018-09-10 07:51:44 -04:00
Brad King
292ec157b6 CTest: Fix --test-load regression
The `ctest --test-load` option is implemented in `StartNextTests` by not
starting any tests when the load is too high and instead sleeping and
then returning.  Prior to commit v3.11.0-rc1~117^2 (CTest: Re-implement
test process handling using libuv, 2017-12-10) our outer loop in
`RunTests` would immediately call `StartNextTests` again.  However, now
the `uv_run` loop may simply terminate if there are no tests running
because no events are left pending.

Fix this by converting the sleep in `StartNextTests` into a libuv timer
that it starts instead.  This avoids leaving `uv_run` with no pending
events.  In the case that there are other running tests this also allows
CTest to detect when they finish even if it during the wait period where
we previously slept.

This regression was not caught by the test suite because it only
verified that we do not start new tests when the load was too high and
not that we proceed to start tests when the load drops.  Revise the test
suite to cover both.

Fixes: #18338
2018-09-10 07:32:16 -04:00
Craig Scott
d6b06d8d87 GoogleTest: Modify test to verify that empty files can be scanned
The modified test confirms the bug described in issue #18321.
2018-09-10 16:21:48 +08:00
Craig Scott
49cb2a504d Merge topic 'ExternalProject-check-explicit-include'
df1ddeec12 ExternalProject: Report error if local variables are not defined

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !2281
2018-09-07 19:40:24 -04:00
Brad King
bea390e9bd Fix dependency propagation through same-name imported targets
If two imported targets in different directories have the same name we
should still be able to propagate transitive link dependencies from
both.  Fix the target and link dependency analyzers to de-duplicate
targets using target pointers rather than target names since the
pointers will not be duplicated even if the names are.

Issue: #18345
2018-09-07 09:23:43 -04:00
Jean-Christophe Fillion-Robin
df1ddeec12 ExternalProject: Report error if local variables are not defined
Since in some situations, ExternalProject module may be included in
a sub-directory, functions will be available in the global scope but
local variables like "_ep_keywords_<keyword>" will not be defined, this
commit checks and reports an error indicating that the ExternalProject
module must be explicitly included before using any of the ExternalProject_*
functions  that require the module's inclusion within the current scope
or above.

Co-authored-by: Pablo Hernandez <pablo.hernandez@kitware.com>
Co-authored-by: Craig Scott <craig.scott@crascit.com>
2018-09-06 23:02:24 +10:00
Brad King
612975c665 Merge topic 'cpack_test'
7a7e94d6f7 CPack (DEB/RPM): add test for per-component description/summmary.

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2333
2018-09-04 09:59:12 -04:00
Brad King
e48a278cdc Merge topic 'no-sanitizer-logfile'
5aaaee5e9e ctest_memcheck: Change failure to find log file from error to warning

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2323
2018-08-31 14:44:32 -04:00
David Faure
7a7e94d6f7 CPack (DEB/RPM): add test for per-component description/summmary. 2018-08-30 22:08:11 +02:00
Brad King
b11e021bed Merge topic 'cpack-ext-stage-and-run'
4a0f664aaf CPackExt: Add CPACK_EXT_ENABLE_STAGING and CPACK_EXT_PACKAGE_SCRIPT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2272
2018-08-30 09:24:31 -04:00
Brad King
e3a521f02b Merge topic 'FindPackageModeMakefileTest-use-explicit-linkage'
03f22cd188 FindPackageModeMakefileTest: Explicitly use C linkage

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2328
2018-08-30 09:23:39 -04:00
Brad King
14553ab64b Merge topic 'android-ndk-r18'
ca97d4cb5f Android: Add support for NDK r18

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2319
2018-08-30 09:14:32 -04:00
Chuck Atkins
03f22cd188 FindPackageModeMakefileTest: Explicitly use C linkage
This explicitly uses C linkage for the library code used by the test to work
around some compilers (Solaris Studio 12.4) that implicitly assume incorrect
linkage information.  Since something else entirely is being tested here,
this allows the test to proceed as needed on the affected platforms.
2018-08-29 13:02:09 -04:00
Betsy McPhail
5aaaee5e9e ctest_memcheck: Change failure to find log file from error to warning
Sanitizers do not create a log file when no defects are found. Therefore,
it is currently impossible for ctest_memcheck to set both
`CAPTURE_CMAKE_ERROR` and `RETURN_VALUE` to zero.


With defects, `CAPTURE_CMAKE_ERROR`=0 and `RETURN_VALUE`=-1, as expected.

With no defects, `CAPTURE_CMAKE_ERROR`=-1 and `RETURN_VALUE`=0.
2018-08-28 16:45:49 -04:00
Brad King
0e764082fe Merge branch 'android-ndk-r18' into release-3.12
Merge-request: !2319
2018-08-28 09:44:03 -04:00
Brad King
ca97d4cb5f Android: Add support for NDK r18
NDK r18 drops GCC toolchains and some STL types.  We need to choose a
clang toolchain by default when no gcc toolchains are available.  Switch
the STL type default to `c++_static` when the old `gnustl_static`
default is not available.

Update the test suite to not run tests for STL types that do not exist.
Also do not expect the gcc toolchain `cpp` tool to be available because
r18 does not provide it.  Also teach it to tolerate `gcc -dumpmachine`
output like `arm--linux-android` that differs from the toolchain prefix.

Fixes: #18301
2018-08-28 09:27:26 -04:00
Brad King
ce153cacc7 Merge topic 'static-lib-options'
974de0e199 static library: add property STATIC_LIBRARY_OPTIONS

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2290
2018-08-27 14:04:22 -04:00
Brad King
9903ec1677 Merge topic 'ninja-generator-do-not-add-alias-matching-custom-command-output'
180c2f8de8 Ninja: Fix dupbuild error skipping alias with conflicting custom command

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Isaiah <isaiah.norton@gmail.com>
Merge-request: !2276
2018-08-27 13:57:05 -04:00
Brad King
36f49faa3c Merge topic 'cuda-no-cublas_device'
122c79748c CUDA: Avoid using deprecated cublas_device to identify device lib dirs

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2296
2018-08-24 13:35:01 -04:00
Brad King
a173118f8c Merge branch 'cuda-no-cublas_device' into release-3.12
Merge-request: !2296
2018-08-23 14:51:33 -04:00
Robert Maynard
122c79748c CUDA: Avoid using deprecated cublas_device to identify device lib dirs
Use `curand_static` to identify directories containing device libraries
because `cublas_device` is deprecated and will be removed in the future.

Issue: #18290
2018-08-23 14:43:31 -04:00
Craig Scott
6b1089399a Merge topic 'export-properties-undefined'
dbd3e2c53d EXPORT_PROPERTIES: Prevent null dereference for undefined property
b88bf6796e EXPORT_PROPERTIES: Add test for an undefined property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2294
2018-08-17 20:51:17 -04:00
Craig Scott
b88bf6796e EXPORT_PROPERTIES: Add test for an undefined property
The added test verifies that a property listed in EXPORT_PROPERTIES
can be undefined. It confirms the crash recorded in issue #18260.
2018-08-16 22:21:25 +10:00
Marc Chevrier
974de0e199 static library: add property STATIC_LIBRARY_OPTIONS
issue: #18251
2018-08-15 15:20:18 +02:00
Marc Chevrier
174721ecc0 LINK_OPTIONS property: add test for static library.
Check that property INTERFACE_LINK_OPTIONS is correctly propagated
from static libraries.

Issue: #18251
2018-08-15 14:40:36 +02:00
Craig Scott
349f8bfb25 Merge topic 'doc-consistently-reference-packagename'
30d08bdce9 doc: Consistently use <PackageName> for describing the name of a package

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2283
2018-08-15 08:18:49 -04:00
Craig Scott
a6f7a01f3a Merge topic 'better_static_link_flags_docs'
6b17d85873 Help: Document when LINK_FLAGS and STATIC_LIBRARY_FLAGS are used
9561d42f95 target_link_options: Add test to verify static library behavior

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !2274
2018-08-15 07:58:39 -04:00