Commit Graph

8311 Commits

Author SHA1 Message Date
Brad King acb33d0904 Merge topic 'fetchcontent-performance'
17e5516e60 FetchContent: Invoke steps directly and avoid a separate sub-build
4f3d1abbb4 ExternalProject: Refactor pre-configure steps to support no-target uses
23aab9ecce ExternalProject: Avoid scanning docs for keywords, use include_guard()

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Acked-by: Michael Hirsch, Ph.D. <michael@scivision.dev>
Acked-by: Lars Melchior <lars.melchior@gmail.com>
Merge-request: !5749
2021-02-05 07:01:05 -05:00
Brad King 2c2eb777f4 Merge topic 'build-test-presets'
9b5289ebd8 Help: Add release note for build and test presets
c8a5cd6871 Tests: Update RunCMake/CMakePresets --list-presets
69a5cf23a2 Tests: Update RunCMake/CommandLine BuildDir
b500935b94 Tests: Add test preset tests
74a86566f0 Tests: Add build preset tests
56751c83aa Tests: Factor out RunCMake.CMakePresets schema validation
676ecf0d37 cmake-presets: Add build and test presets
4f4f2028b8 Help: Add documentation for buildPresets and testPresets
...

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5681
2021-02-05 06:57:28 -05:00
Craig Scott 17e5516e60 FetchContent: Invoke steps directly and avoid a separate sub-build
The cost of setting up and executing a separate sub-build to do the
download, update and patch steps required for FetchContent population
can be significant with some platforms and CMake generators. Avoid the
sub-build altogether by invoking the step scripts directly.

Previously, if no generator was set (e.g. population was being done in
script mode), a generator needed to be available on the default PATH.
Since we no longer use a sub-build, this restriction is also now gone.

Fixes: #21703
2021-02-05 07:33:38 +11:00
Craig Scott 4f3d1abbb4 ExternalProject: Refactor pre-configure steps to support no-target uses
The mkdir, download, update and patch steps are used by
FetchContent during the configure phase of the main build. Because
these steps need a target, this has so far required a sub-build to be
set up. The changes here factor out the preparation of the scripts
from the creation of the targets, allowing future work to leverage these
steps without a sub-build (see #21703).

As part of the refactoring, some rationalisation of the stamp files,
repository info files and script names was done to make things more
consistent between download methods and step implementations.
Every download method now records its own specific repository info
in a file and that file is a dependency of the download step. The source
directory is also written to that file, so if the SOURCE_DIR changes, the
download will be retriggered (the existing implementation fails in this
scenario). Each download method now also has just one driver script
that implements the whole step (it may pull in other scripts to do its
task though). The patch step gained support for USES_TERMINAL as
a result of generalising the implementation for custom commands.

Fixes: #21748
2021-02-05 07:33:38 +11:00
Sam Freed c8a5cd6871 Tests: Update RunCMake/CMakePresets --list-presets 2021-02-04 11:39:55 -05:00
Sam Freed 69a5cf23a2 Tests: Update RunCMake/CommandLine BuildDir 2021-02-04 11:39:55 -05:00
Sam Freed b500935b94 Tests: Add test preset tests 2021-02-04 11:39:52 -05:00
Sam Freed 74a86566f0 Tests: Add build preset tests 2021-02-04 11:39:19 -05:00
Sam Freed 56751c83aa Tests: Factor out RunCMake.CMakePresets schema validation
Make it available to similar tests.  Also fix whitespace
in generated error message.
2021-02-04 11:00:42 -05:00
Brad King 67cb006732 Merge topic 'aix-xcoff-edit'
e017ba046c AIX: Enable XCOFF editing to replace RPATH on installation
56fc4a325f cmXCOFF: Add helper to parse and edit the XCOFF binary format
ddaaee907d CMakeDetermineCompilerId: Recognize XCOFF executable format
69e1d95a8a Tests: Add sample XCOFF binaries
f79d991dfd Tests: Convert CMake.ELF to RunCMake.file-RPATH ELF case
d8f3e68ca9 Ninja Multi-Config: Enable relink diagnostic message
cdcfe3eb99 Rename CMAKE_USE_MACH_PARSER to CMake_USE_MACH_PARSER
b6071c93f5 Rename CMAKE_USE_ELF_PARSER to CMake_USE_ELF_PARSER

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5769
2021-02-04 08:29:57 -05:00
Brad King 4cd23c5e0d Merge topic 'issue-17634'
5af38a11ce try_run: Allow to set working directory

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5757
2021-02-04 08:22:19 -05:00
Brad King e017ba046c AIX: Enable XCOFF editing to replace RPATH on installation
Avoid relinking before installation.
2021-02-03 12:26:58 -05:00
Brad King 69e1d95a8a Tests: Add sample XCOFF binaries
Generate the binaries as follows:

    $ cat main.c
    int main(void) { return 0; }
    $ xlc -q64 -o xcoff64.bin -Wl,-blibpath:/sample/rpath:/usr/lib:/lib main.c
    $ strip -X 64 xcoff64.bin
    $ xlc -q32 -o xcoff32.bin -Wl,-blibpath:/sample/rpath:/usr/lib:/lib main.c
    $ strip -X 32 xcoff32.bin
2021-02-03 12:26:23 -05:00
Brad King f79d991dfd Tests: Convert CMake.ELF to RunCMake.file-RPATH ELF case 2021-02-03 12:26:02 -05:00
Brad King a24679e9f3 Merge topic 'pch-reuse-from-obj-msvc'
c450d66daa PCH: Remove restrictions for REUSE_FROM signature for MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5765
2021-02-03 10:47:38 -05:00
Asit Dhal 5af38a11ce try_run: Allow to set working directory
Fixes: #17634
2021-02-03 08:42:05 +01:00
Cristian Adam c450d66daa PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 15:03:55 -05:00
Brad King 8d379e7406 Revert "PCH: Remove restrictions for REUSE_FROM signature for MSVC"
This reverts commit 9f06097141.
It was merged accidentally.
2021-02-02 15:02:08 -05:00
Brad King 7cbaf6d87a Merge topic 'pch-reuse-from-obj-msvc'
9f06097141 PCH: Remove restrictions for REUSE_FROM signature for MSVC

Acked-by: Kitware Robot <kwrobot@kitware.com>
Rejected-by: Cristian Adam <cristian.adam@gmail.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !5728
2021-02-02 15:00:25 -05:00
Cristian Adam 9f06097141 PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
2021-02-02 19:11:44 +01:00
Cristian Adam 05f16ca7ee file(CONFIGURE): Use text mode for default OUTPUT content
This affects only Windows where \n will be translated as \r\n

Fixes: #21769
2021-02-02 15:18:48 +01:00
Brad King 8387aa20f2 Merge topic 'issue-19198'
255df8622b file(GENERATE): Support new line style

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !5649
2021-02-02 08:53:07 -05:00
Brad King 7b38688e22 Merge topic 'fix21727_for_FindOpenSSL'
bc00cf9300 FindOpenSSL: Add support for version-range

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5750
2021-02-02 08:49:44 -05:00
Brad King 932b45ceb9 Merge topic 'shlibdeps-fixup'
1aefa86c31 Tests: Accept line breaks in more places in dpkg-shlibdeps error message

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5751
2021-02-02 08:49:00 -05:00
Brad King 1b5f4a615b Merge topic 'tests-setgid'
8213390a3e Added `SETUID` and `SETGID` to the list of accepted file permissions
f41d0e0c77 Tests: Explicitly set permissions in CPack tests to avoid perimssions errors

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5754
2021-02-02 08:47:55 -05:00
Brad King b8e3c821fe Merge topic 'bad-dns-no_proxy'
c0b1f5f30c Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5752
2021-02-02 08:47:01 -05:00
william.r.dieter 1aefa86c31 Tests: Accept line breaks in more places in dpkg-shlibdeps error message
The RunCPackVerifyResult-shlibdeps-with-private-lib-failure test failed
intermittently due to sometimes breaking lines in its output in different
places.  This change accepts line breaks in more places in the command
output.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-02-01 10:32:51 -05:00
Brad King a28bb8de23 Merge topic 'file-configure-newline'
6e225efd8c file(CONFIGURE): Fix newlines in CONTENT

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5747
2021-02-01 10:06:27 -05:00
Deniz Bahadir bc00cf9300 FindOpenSSL: Add support for version-range 2021-02-01 12:27:05 +01:00
Asit Dhal 255df8622b file(GENERATE): Support new line style
Fixes: #19198
2021-02-01 01:38:19 +01:00
william.r.dieter f41d0e0c77 Tests: Explicitly set permissions in CPack tests to avoid perimssions errors
When the user has the setgid bit is set on the parent directory of
the build directory, the setgid bit will be propagated throughout the
build tree.  Most tests do not care about permissions as long as they
can read and write the files the need.  The CPack tests, however, validate
that permissions match an expected set, and fail with the setgid bit set.

Explicitly set permissions on directories created in the CPackTestHelpers
to clear the setgid bit.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-01-29 16:29:09 -05:00
william.r.dieter c0b1f5f30c Tests: Add host to ENV{no_proxy} when DNS lookup failure is expected
DNS lookup of an invalid host name fails with a different error in a proxy
environment than it does in an environment without proxy.  Many tools,
including curl, use the `no_proxy` environment variable to provid a list
of hosts for which proxy should not be used.

To make lookup failure consistent, add invalid host names to the
`no_proxy` environment variable in tests that attempt to look up invalid
host names.  This way the lookup will fail consistently regardless of
whether proxy is generally used or not.

Signed-off-by: william.r.dieter <william.r.dieter@intel.com>
2021-01-29 16:22:15 -05:00
Craig Scott 525363447f Merge topic 'cmake_path-stabilization'
76cea3dfe2 cmake_path: rename 'GET ... RELATIVE_PATH' to 'GET ... RELATIVE_PART'

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5743
2021-01-29 08:57:33 -05:00
Cristian Adam 6e225efd8c file(CONFIGURE): Fix newlines in CONTENT
Fixes: #21749
2021-01-29 14:25:33 +01:00
Craig Scott 23aab9ecce ExternalProject: Avoid scanning docs for keywords, use include_guard()
The previous implementation was scanning the documentation in
the file at runtime to determine the set of supported keywords for
each public function. This was fragile, made it difficult to restructure
the documentation and was sometimes observable in runtime
performance measurements. Change to a more conventional
approach where supported keywords are explicitly listed in the
code.

The internal _ExternalProject_SELF variable is no longer needed.
CMake now provides CMAKE_CURRENT_FUNCTION_LIST_DIR which
can be used for the same purpose and avoids having to set a
variable when the module is read. This also removes the
requirement that the module must be included by the current or a
parent scope. It is now enough that the module has been included
once somewhere before calling any of its functions. 

The above changes combined mean that the module can now use
include_guard() and avoid having to re-parse the very long file every
time.
2021-01-30 00:12:23 +11:00
Brad King 36bb0e32d7 Merge topic 'externalproject-update-refactor'
ac6a4d4884 ExternalProject: Improve robustness of update step
17c4c8b92b Tests: Prevent the noisy CMP0114 warnings in ExternalProjectUpdate test
1cb65e680d ExternalProject: Prevent the noisy detached head messages on checkout

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5389
2021-01-29 08:10:21 -05:00
Craig Scott ac6a4d4884 ExternalProject: Improve robustness of update step
Refactor the update logic to make it easier to follow. The following
fixes/improvements are some consequences of this change:

* Absorb a confusing git checkout failure message when the failure
  is allowed and we act on that failure appropriately.
* Fix an unnecessary fetch in some scenarios when checking out a
  git hash we already have locally.
* Stash and restore any local changes even when not rebasing.
* Avoid unsafe rebasing where we are not on a branch that is
  already tracking the requested branch.
* When fetching, use --tags --force to ensure we get all the tags
  and commits leading up to them regardless of whether the tags
  are on branches or not. Also update our local tags if they move
  on the remote.

Fixes: #20677
2021-01-28 09:32:35 -05:00
Craig Scott 17c4c8b92b Tests: Prevent the noisy CMP0114 warnings in ExternalProjectUpdate test 2021-01-28 09:32:35 -05:00
William R. Dieter 9b5fd04905 Tests: Disable MFC test for IntelLLVM due to #18311
clang-cl cannot deal with implicit dependencies in UTF16 files
(see #18311).  IntelLLVM inherits this behavior from Clang.  The
MFC test uses `rc` in the way described in #18311 and gets the same
error described in #18311.  Disable the test until #18311 is fixed.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:02 -05:00
William R. Dieter ccdf7c0005 Tests: Skip VSGNUFortran test for ifx.
DLLEXPORT is not implemented in ifx yet, and required by this test.
2021-01-28 09:07:02 -05:00
William R. Dieter ddaf412dd0 Tests: Skip per file PDBs in PDBDirectoryAndName for IntelLLVM
The IntelLLVM C compiler do not yet support PDBs per file with the /Fd
option.  Disable the parts of PDBDirectoryAndName that tries to generate
them so that the test will pass.
2021-01-28 09:07:02 -05:00
Brad King a619b32768 Tests: Update RunCMake.GenerateExportHeader for IntelLLVM
On Windows, the expected results are like Clang's.
2021-01-28 09:07:01 -05:00
Brad King 661b04d6a6 Tests: Skip old PrecompiledHeader test on IntelLLVM
This test uses hard-coded flags for a fixed set of compilers.
We have first-class PCH support implemented for IntelLLVM.
2021-01-28 09:07:01 -05:00
Brad King 01b1e9c40d Tests: Update CompileFeatures test for IntelLLVM
We do not have granular features for this compiler.
2021-01-28 09:07:01 -05:00
Brad King f26f10184f Tests: Update Module.WriteCompilerDetectionHeader for IntelLLVM 2021-01-28 09:07:01 -05:00
Brad King 3ceb364b1c Tests: Update RunCMake.FileAPI for IntelLLVM 2021-01-28 09:07:01 -05:00
William R. Dieter 12720a5b71 Tests: Update MSVCRuntimeLibrary.Fortran test for IntelLLVM
`ifx` needs the same command line arguments as `ifort`.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:01 -05:00
William R. Dieter d83df2af57 Tests: Update Preprocess test for IntelLLVM
Work around an icx bug in command line handling of preprocessor macros.

A `\\\"` string in a macro passed to icx on the command line is not
properly parsed in compiler versions 2021.1.0 and earlier.  This problem
is expected to be fixed, though a target release has no been set yet.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:01 -05:00
William R. Dieter 7de61526a0 Tests: Update CPack DEBUGINFO tests for IntelLLVM
By default icx and icpx do not add build IDs when linking, so enable
the build ID to make the test pass.

Signed-off-by: William R. Dieter <william.r.dieter@intel.com>
2021-01-28 09:07:01 -05:00
Brad King ae9f986da1 Tests: Update Assembler test for IntelLLVM
Enable parts of the test the same way we do for `Intel`.
2021-01-28 09:07:01 -05:00