Revert the library target dependency forwarding to the `_autogen` target
to the 3.9.6 way, only now using `GetLinkImplementationLibraries`.
Fixes: #17278
The backtrace information is very repetitive and hugely increases the
size of the codemodel object. We need to remove it until an alternative
representation can be developed. Revert commit v3.10.0-rc1~393^2
(server: Report backtraces in codemodel response, 2017-06-20), except
for the protocol version number (because it indicates other new things).
Unfortunately this is incompatible with clients that expect the
"crossReferences" field in targets. However, the regression in memory
usage is quite serious, especially on large projects, and therefore
breaks even older clients that do not use backtraces. Since the
"crossReferences" field was only provided by one release (3.10.0), it is
simplest to revert it outright for 3.10.1.
Fixes: #17502
Add a test to verify expected behavior when a test executable on which
gtest_discover_tests is invoked was not built. (The test for the newly
added timeout conveniently sets up this situation, so this new test was
almost trivial to add.)
Add a TIMEOUT option to gtest_discover_tests. This provides a
work-around in case a test goes out to lunch, rather than causing the
build to simply hang. (Although this is still a problem with the user's
project, hanging the build is not cool, especially in the case of
automatically running CI builds. It is much preferred that the build
should actively fail in this case, and it is trivially easy for us to
implement that.)
Due to a erroneous logical dependency on a temporary variable, FindMPI
would depend its FOUND status on the set of flags needed to support
compiler-implicit MPI support after the first configure run.
This behavior is especially causing a misreported NOT FOUND status after
the first run on MPI implementations without MPI compiler like MS-MPI or
MPICH2 on Windows.
Due to a minor logic error, MPI_LIBRARY, MPI_EXTRA_LIBRARY and
MPI_<LANG>_LIBRARIES hints are currently not correctly handled and
discarded.
Additionally, if either C or CXX aren't enabled, there subsequent calls
to FindMPI will cause cache variables of the sort "MPI_MPI_EXTRA_LIBRARY-NOTFOUND"
to appear due to an error in the compatibility handling. (Doesn't affect
functionality)
Refactoring in commit v3.7.0-rc1~523^2 (CPack/PackageMaker: port to
cmXMLWriter, 2016-06-08) accidentally broke `distribution.dist`
generation when there are dependencies between components and the pkg
(or the derived productbuild) generator are used. The resulting
package cannot be installed and instead the Apple Installer app
shows a "Javascript error" message.
The problem is that a `std::ostringstream` is constructed with some
content, but the stream pointer still points to the beginning of the
stream, so subsequent writes overwrite the initial content instead of
appending.
Some versions of clang 5 (with libc++) have a problem with
`unordered_map` under `-std=gnu++1z`:
/usr/include/c++/__hash_table:1134:43: error: conflicting types for '__hash_table<_Tp, _Hash, _Equal, _Alloc>'
Include `unordered_map` in our test source so that we reject this
combination and fall back to an older C++ standard flag.
Fixes: #17526
The check added by commit v3.10.0-rc2~2^2 (Clang: Diagnose unsupported
GNU-like clang targeting MSVC ABI, 2017-10-10) is incorrectly detecting
clang-cl 6.0 as GNU-like. Currently cmake is testing if the clang
compiler accepts `--version` to see if it accepts GNU style flags.
However, with the latest llvm snapshot this also works for clang-cl:
> clang-cl --version
clang version 6.0.0 (trunk)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
So instead we should use the `/?` flag which fails with clang but
works with clang-cl:
> clang-cl /? &> /dev/null; echo $?
0
> clang /? &> /dev/null; echo $?
1
Fixes: #17518
According to the documentation, tests can be discovered for a target
multiple times by using a different prefix and/or suffix to ensure name
uniqueness. However, while this worked for gtest_add_tests, it did not
work with gtest_discover_tests because the generated file that sets up
the tests was named based only on the target name, and so subsequent
discovery from the same target would clobber earlier discovery.
Fix this by introducing a counter that records how many times discovery
has been used on a target, and use this to generate unique names of the
generated test list files.
If a partial message is flushed into the input pipe for CMake Server,
the parser will try and parse it as a full message because of some bad
loop checks. This was introduced accidentally in commit
v3.10.0-rc1~365^2~2 (server: Refactor to make the event loop owned by
server object, 2017-03-24).
Since commit v3.10.0-rc5~3^2 (FindOpenGL: Default to non-GLVND libraries
for legacy GL, 2017-11-08) users may set `OPENGL_gl_LIBRARY` to empty to
use GLVND components for the legacy GL interfaces. This is useful only
when one knows in advance that the GLVND components will be found.
Add a `OpenGL_GL_PREFERENCE` variable to specify a preference for legacy
GL or GLVND. The latter can suppress `OPENGL_gl_LIBRARY` only when the
needed GLVND components are found. If no preference is explicitly
specified, choose a default based on whether GLVND components were
requested (because this indicates the project has been updated for
CMake 3.10).
Issue: #17437
Issue: #17449
A diagnostic message added in commit v3.10.0-rc1~59^2 (Windows: Improve
link-time error messages when rc or mt fail, 2017-09-22) incorrectly
reports the `mt /notify_update` special return code as a failure.
Fix the logic to consider the special return codes as success.
Fixes: #17444
`DOXYGEN_DOT_FOUND` is only set if `_Doxygen_keep_backward_compat` is
used (when no components are requested), so use `Doxygen_dot_FOUND`
directly. Preserve the "YES" or "NO" value used previously.
Projects using `OPENGL_LIBRARIES` or `OpenGL::GL` expect legacy GL.
Although GLVND OpenGL+GLX provides legacy GL interfaces, using those
library files may conflict with legacy GL library files used by
dependencies (or dependents) of such projects. Therefore we should
not yet use OpenGL+GLX when a legacy GL library is available.
If `OPENGL_gl_LIBRARY` is set then use it as the legacy GL library.
If it is *not* set then fall back to using GLVND OpenGL+GLX to provide
legacy GL interfaces. This will allow users to build projects using
GLVND even if they have not been ported.
Fixes: #17437
Fix a typo from commit v3.6.0-rc1~85^2 (HDF5: Refactor the use of
compiler wrappers, 2016-04-04) that accidentally used the HDF5 C++
version (which could be empty) while detecting the C patch version.
The detection failed for patch releases, such as `1.10.0-patch1`
becoming `.1` instead of `1.10.0.1`.
Since commit v3.9.0-rc1~148^2 (Do not assume GCC libs are linked by all
compilers, 2017-05-05) we no longer filter out all `gcc*` implicit link
libraries. This allows mixing of gcc and non-gcc compilers across
languages. However, this caused a subtle problem with how GCC makes
exception handling symbols available to linked binaries.
GCC (at least on MinGW) provides two different libraries with exception
handling symbols:
* gcc_s: A shared library with -fvisibility=default, used by -shared-libgcc.
* gcc_eh: A static library with -fvisibility=hidden, used by -static-libgcc.
The C compiler (on MinGW) defaults to -static-libgcc and uses gcc_eh.
The C++ compiler defaults to -shared-libgcc and uses gcc_s when linking
shared libraries and executables so that exceptions can propagate across
shared libraries [1]. When linking a mixed-language binary, the C++
compiler should be used along with its choice of gcc_s. In this case
gcc_eh should not be added even though the C compiler implies it because
gcc_s supersedes it.
Since the above-mentioned change, CMake is adding gcc_eh to C++ link
lines that also contain C code on MinGW. This causes both gcc_s and
gcc_eh to be used, which is incorrect. We can fix this simply by
excluding gcc_eh from the C compiler's implicit link libraries.
[1] https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gcc/Link-Options.html#Link-OptionsFixes: #17436
When we run `csc.exe /help` we look for "Version" in the output.
Explicitly ask for the output in English.
Reported-by: guttally@users.noreply.github.com