Commit Graph

38838 Commits

Author SHA1 Message Date
Brad King
6e59491659 add_custom_{command,target}: Fix crash on empty expanded command
Our custom command generation logic assumes that all command lines have
at least `argv0`.  In `add_custom_{command,target}` we already check
that at least a `COMMAND` was given, but using `COMMAND_EXPAND_LISTS` in
combination with a generator expression that expands to an empty string
may produce an empty command line.  In this case simply add an empty
string as a command to maintain our internal invariant.

Fixes: #17993
2018-05-14 11:54:27 -04:00
Brad King
fbe6cd1596 CMake 3.11.1 2018-04-17 08:33:46 -04:00
Brad King
d1d43a6dbf Merge branch 'bootstrap_system_libuv_option' into release-3.11
Merge-request: !1971
2018-04-17 07:52:19 -04:00
Kirill Erofeev
bbf64794ac bootstrap: Add option to enable/disable usage of system libuv 2018-04-17 07:44:01 -04:00
Brad King
054c849112 Merge branch 'FindOpenMP-Intel-Windows' into release-3.11
Merge-request: !1957
2018-04-16 14:12:46 -04:00
Roland Schulz
0c7433e874 FindOpenMP: Fix support for Intel on Windows
The change in commit v3.11.0-rc1~334^2 (FindOpenMP: Use NO_DEFAULT_PATH
where appropriate, 2017-11-15) broke partial support for Intel on Windows.
Since `OpenMP_${LANG}_IMPLICIT_LINK_DIRS` is empty for this compiler
the `find_library` call without `NO_DEFAULT_PATH` worked accidentally
in environments with the needed libraries in the search path already.

Fix support for Intel on Windows by simply removing our explicit search
for the `libiomp5md` library.  In cases that it is needed, the compiler
already inserts metadata in `.obj` files to tell the MSVC linker to use
the library.

Suggested-by: Christian Pfeiffer <cpfeiffer@live.de>
Fixes: #17910
2018-04-16 14:11:12 -04:00
Brad King
90cdd06f4c Merge branch 'implicit-lib-gcceh-file' into release-3.11
Merge-request: !1967
2018-04-16 11:58:30 -04:00
Brad King
eb0498357f Exclude "libgcc_eh" library files from implicit link libraries
Extend the fix in commit v3.9.6~1^2 (Restore exclusion of "gcc_eh" from
implicit link libraries, 2017-11-07) to also exclude `gcc_eh` libraries
referenced by absolute path to the library file.

Issue: #17436
2018-04-16 11:56:23 -04:00
Brad King
cb8c758fdb Merge branch 'libuv_version_bump' into release-3.11
Merge-request: !1966
2018-04-16 11:38:17 -04:00
ErofeevK
f5f72ff844 Explicitly require LibUV 1.10 or higher to build CMake
CMake 3.11 now uses `uv_translate_sys_error` introduced in LibUV 1.10.
2018-04-16 11:33:52 -04:00
Brad King
d00306636b Merge branch 'backport-fix-explicit-CMakeLists.txt' into release-3.11
Merge-request: !1959
2018-04-13 09:49:51 -04:00
Brad King
8480c2afc0 Restore support for explicitly referenced CMakeLists.txt sources
Since commit v3.11.0-rc1~467^2 (VS,Xcode: Add CMakeLists.txt sources
without mutating targets, 2017-10-18) we do not add `CMakeLists.txt` to
target sources but instead generate references to them directly.  This
broke projects that explicitly specify their `CMakeLists.txt` file as a
source file because the explicit entry is no longer consolidated with
the generated one.

Teach the relevant generators to avoid duplicating `CMakeLists.txt`
source references and add test cases.

Fixes: #17828
2018-04-13 09:41:06 -04:00
Brad King
61607fffbb Merge branch 'features-msvc-2017' into release-3.11
Merge-request: !1903
2018-04-11 11:30:02 -04:00
Daniel Filipe
5f4272cc06 Features: Record for VS 2017 through 15.6
VS 15.3 has more features than we recorded in commit v3.7.0-rc1~156^2~2
(Features: Record features for VS 15 Preview 4, 2016-09-05).

While at it, update comments and simplify some cases.
2018-04-11 11:27:07 -04:00
Brad King
3c0fed488f Merge branch 'cpack-trace-nullptr' into release-3.11
Merge-request: !1950
2018-04-10 15:01:43 -04:00
Brad King
6f2701abf6 CPack: Fix crash on invalid generator name
In commit v3.11.0-rc1~68^2 (CPack: accept --trace and --trace-expand,
2017-12-09) a nullptr dereference was added that occurs when
`cpack -G NotAGenerator` is invoked.  Add the needed condition.

Fixes: #17900
2018-04-10 15:00:37 -04:00
Brad King
ef077c8ba4 Merge branch 'fix-crash-trace-exp-uninit-vars' into release-3.11
Merge-request: !1944
2018-04-09 12:01:10 -04:00
R2RT
aad360eb3d Fix crash with --trace-expand --warn-uninitialized together
Some code paths in `ExpandVariablesInString{New,Old}` were not checking
the `filename` parameter for a null pointer, but this can happen when
using the above flags together.  Add the checks and a test case.

Fixes: #17896
2018-04-09 11:59:07 -04:00
Brad King
1c85742701 Merge branch 'revert-CheckIncludeFile-required-libs' into release-3.11
Merge-request: !1931
2018-04-04 13:17:30 -04:00
Brad King
35109e718b Revert "CheckIncludeFiles: Honor CMAKE_REQUIRED_LIBRARIES"
This reverts commit v3.11.0-rc1~108^2 (CheckIncludeFiles: Honor
CMAKE_REQUIRED_LIBRARIES, 2017-12-24).  The behavior change can
affect checks in existing projects that don't expect the behavior.
Introducing the behavior again will require a policy.

Fixes: #17874
Issue: #9514
2018-04-04 13:14:01 -04:00
Brad King
b1aa90f057 Merge branch 'autogen-protect-cmsys-calls' into release-3.11
Merge-request: !1918
2018-04-04 11:20:53 -04:00
Sebastian Holtermann
b11e2c80b1 Autogen: Print moc/uic/rcc output to stdout
The output of moc/uic/rcc used to be discarded unless
the program failed. This lets moc/uic/rcc print their
output to stdout even on success.

Closes #17860
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
1d2c9d8c6d Autogen: Use std::istreambuf_iterator for file so string reading
This adds a dedicated mutex for file reading and writing to
cmQtAutoGenerator::FileSystem. The purpose of the change is
to avoid that long files reads block cmsys based path computations,
which are protected by an other mutex.
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
ccc38fa509 Autogen: Protected calls to cmFilePathChecksum
Closes #17861
Closes #17862
2018-04-03 17:20:30 +02:00
Sebastian Holtermann
719b24c872 Autogen: Protected calls to cmQtAutoGen::SubDirPrefix 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
9a73615815 Autogen: Protected calls to cmSystemTools::GetFilenameWithoutLastExtension 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
65203ce407 Autogen: Protected calls to cmSystemTools::Split/JoinPath 2018-04-03 17:20:30 +02:00
Sebastian Holtermann
14a86c9ea7 Autogen: Protected calls to cmSystemTools::CollapseCombinedPath 2018-04-03 17:20:29 +02:00
Brad King
61fd4c7420 CMake 3.11.0 2018-03-28 07:26:56 -04:00
Brad King
36881ee416 Merge branch 'ctest_update-memory-problems' into release-3.11
Merge-request: !1893
2018-03-27 08:51:01 -04:00
Brad King
27f033550a ctest_update: Fix crash when handling svn externals
Refactoring in commit v3.9.0-rc1~156^2 (c++: prefer vectors over lists,
2017-05-04) switched `cmCTestSVN::Repositories` from `std::list` to
`std::vector`.  This can cause re-allocation when svn externals are
processed and break the `RootInfo` pointer that is supposed to point at
the first repository element.  Switch back to `std::list` so that the
address remains stable.

Fixes: #17854
2018-03-27 08:46:20 -04:00
Brad King
75e8af3354 cmSystemTools: Fix ParseArguments out-of-bounds read
When checking for a Windows-style leading path, do not read past the
null terminator.

Issue: #17854
2018-03-27 08:46:20 -04:00
Brad King
188c5c2a46 Merge branch 'revert-CTestTestfile-removal-again' into release-3.11
Merge-request: !1887
2018-03-26 07:48:15 -04:00
Brad King
70c50aa23c Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF"
Revert commit v3.8.0-rc1~305^2 (Remove CTestTestfile.cmake when BUILD_TESTING
is OFF, 2016-11-14) again.  We reverted it once in commit v3.8.0-rc3~22^2
(Revert "Remove CTestTestfile.cmake when BUILD_TESTING is OFF", 2017-03-06) but
it was accidentally restored by commit v3.11.0-rc1~387^2 (server: add
"ctestInfo" request to get test info, 2017-10-25), perhaps due to conflict
resolution during rebase.

We cannot remove `CTestTestfile.cmake` when testing is off because it breaks
projects that never enable testing but create their own `CTestTestfile.cmake`
manually instead.  Revert the change again and add a test case.
2018-03-26 07:44:22 -04:00
Brad King
218471a35c Merge branch 'boost-1.67' into release-3.11
Merge-request: !1865
2018-03-21 13:36:14 -04:00
Roger Leigh
1673923c30 FindBoost: Add support for Boost 1.67 with Python version suffixes
Fixes: #16612, #16335, #16391, #12955
2018-03-21 13:34:17 -04:00
Brad King
2006e981da Merge branch 'sunpro-5.15' into release-3.11
Merge-request: !1875
2018-03-21 08:53:53 -04:00
Brad King
4267960fc9 Features: Record for SunPro 5.15
Oracle Developer Studio 12.6 adds support for more C++ 11 features.
2018-03-20 11:48:22 -04:00
Brad King
6b9172d759 CMake 3.11.0-rc4 2018-03-19 09:25:26 -04:00
Brad King
c78d12fc0d Merge branch 'revert-findqt4-dirs-fix' into release-3.11
Merge-request: !1867
2018-03-19 09:17:09 -04:00
Brad King
cf06962d73 FindQt4: Revert "Set PLUGINS and IMPORTS dir even if empty"
The change in commit v3.11.0-rc1~306^2 (FindQt4: Set PLUGINS and IMPORTS
dir even if empty, 2017-11-19) regressed existing builds on some
machines.  Revert it for CMake 3.11 pending further investigation.

Fixes: #17814, #17817
Issue: #14155, #17492
2018-03-19 09:13:25 -04:00
Brad King
4e9aa80158 Merge branch 'intel-initializer-list' into release-3.11
Merge-request: !1855
2018-03-16 07:53:36 -04:00
Brad King
df27bd3f83 Merge branch 'gtest_discover_tests_timeout' into release-3.11
Merge-request: !1851
2018-03-16 07:52:23 -04:00
Brad King
fc96d99c3e Features: Record initializer list support for Intel 14 and above
Features recorded by commit v3.6.0-rc1~120^2~5 (Features: Record
standards and features for Intel C++ on UNIX, 2016-04-28) for the Intel
compiler left out initializer list support because our test case in
`Tests/CompileFeatures/cxx_generalized_initializers.cpp` caused an
internal compiler error.  It turns out this is because the Intel
compiler asserts the `initializer_list` constructor signatures to verify
that they match its own `<initializer_list>` header.  It was our dummy
implementation used to test the language feature without any headers
that caused the ICE.  Revise it to use a constructor signature accepted
by the Intel compiler.

Fixes: #17829
2018-03-16 07:47:42 -04:00
Craig Scott
96fdde26bb GoogleTest: Rename TIMEOUT parameter to avoid clash
In gtest_discover_tests(), the TIMEOUT keyword was making it
impossible to set the TIMEOUT test property via the PROPERTIES
keyword. This would be a frequent case, but it doesn't complain
and instead silently does something different to what would
normally be expected. The TIMEOUT keyword has been renamed
to DISCOVERY_TIMEOUT, thereby removing the clash.

This is a breaking change. 3.10.1 and 3.10.2 were the only versions
that supported the TIMEOUT keyword and uses of it were likely
not working as intended.

Fixes: #17801
2018-03-15 07:36:42 -04:00
Brad King
298e1bfe28 Merge branch 'xl-cc-default-std' into release-3.11
Merge-request: !1854
2018-03-14 14:08:23 -04:00
Brad King
194b74daec XL: Fix C default level detection when invoked as 'cc'
The IBM XL C compiler does not define `__STDC__` when invoked as plain
`cc` instead of `xlc`, so `CMAKE_C_STANDARD_COMPUTED_DEFAULT` does not
get set and CMake fails.  Teach CMake about the XL compiler's default C
standard in this case.

Fixes: #17649
2018-03-14 14:07:00 -04:00
Brad King
7bbaead87d Merge branch 'findjni-mips-r6-new-arch' into release-3.11
Merge-request: !1853
2018-03-14 11:18:14 -04:00
YunQiang Su
8c92596e96 FindJNI: add some new architecture names for mips release 6 2018-03-14 11:17:19 -04:00
Brad King
a039029e7c Merge branch 'genex-COMPILE_LANGUAGE-system-include' into release-3.11
Merge-request: !1844
2018-03-13 13:40:25 -04:00