The try_compile command builds the cmTryCompileExec executable using the
cmTryCompileExec/fast target with Makefile generators in order to save
time since dependencies are not needed. However, in project mode the
command builds an entire source tree that may have dependencies.
Therefore we can use the /fast target approach only in one-source mode.
Previously the Fortran test created a single executable containing C,
C++, and Fortran sources. This commit divides the executable into three
libraries corresponding to each language, and two executables testing
Fortran/C only and Fortran/C/C++ together. The result tests more
combinations of using the languages together, and that language
requirements propagate through linking.
When building an entire source tree with try_compile instead of just a
single source file, it is possible that the CMakeLists.txt file in the
try-compiled project invokes try_compile. This commit fixes propagation
of language-initialization results from the outer-most project into any
number of try-compile levels.
The try_compile command project mode builds an entire source tree
instead of one source file. It uses an existing CMakeLists.txt file in
the given source tree instead of generating one. This commit creates a
test for the mode in the TryCompile test.
The commit "Fix get_filename_component ABSOLUTE mode" broke the code
get_filename_component(cwd . ABSOLUTE)
because CTest scripts did not make cmMakefile::GetCurrentDirectory()
available. This commit fixes the problem by setting the proper
information on CTest script instances of cmMakefile.
This also makes CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR
available to CTest scripts. They are set to the working directory at
script startup.
CMake 2.4 generates old-style cmake_install.cmake code including calls
to the file(INSTALL) command with the COMPONENTS argument. We need to
set CMAKE_INSTALL_SELF_2_4 for the whole install tree to prevent the
command from complaining in this special case. Previously this was
needed only in the QtDialog directory, but now it is needed in the
entire tree.
This stores CMAKE_Fortran_COMPILER_SUPPORTS_F90 in the Fortran compiler
information file CMakeFiles/CMakeFortranCompiler.cmake instead of in
CMakeCache.txt. This file makes the result available to try-compile
projects.
The commit "Consider link dependencies for link language" taught CMake
to propagate linker language preference from languages compiled into
libraries linked by a target. It turns out this should only be done for
some languages, such as C++, because normally the language of the
program entry point (main) should be used.
We introduce variable CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES to tell
CMake whether a language should propagate its linker preference across
targets. Currently it is true only for C++.
This factors the decision logic out of cmTarget::ComputeLinkClosure into
dedicated class cmTargetSelectLinker. We replace several local
variables with a single object instance, and organize code into methods.
We set the variables to contain "-v", the verbose front-end output
option for PGI compilers. This enables detection of implicit link
libraries and directories for these compilers.
This adds sample linker invocation lines for the Intel compiler on
Linux. In particular, this exercises the case when "ld" appears without
a full path.
We set the variables to contain "-v", the verbose front-end output
option for Intel compilers. This enables detection of implicit link
libraries and directories for these compilers.
This teaches the implicit link line parsing code to recognize link lines
that do not have a full path to the linker executable. At least one
version of the Intel compiler on Linux invokes the linker as just "ld"
instead of "/usr/bin/ld".
All global generator CreateLocalGenerator methods automatically
initialize the local generator instances with SetGlobalGenerator. In
several places we were calling SetGlobalGenerator again after receiving
the return value from CreateLocalGenerator. The double-initializations
leaked the resources allocated by the first call to SetGlobalGenerator.
This fix removes the unnecessary calls.
We list implicit link items of languages linked into a target but filter
them by the implicit libraries known to be passed by the main linker
language. Implicit link flags like "-z..." should not be filtered out
because they are not libraries.
The Sun Fortran compiler passes -zallextract and -zdefaultextract to the
linker so that all objects from one of its archives are included in the
link. This teaches the implicit options parser to recognize the flags.
We need to pass them explicitly on C++ link lines when Fortran code is
linked.
In cmComputeLinkInformation we recognize link options that look like
library file names, but pass flags starting in '-' through untouched.
This fixes the ordering of the check to recognize '-' flags first in
case the rest of the option looks like a library file name, as in the
case of "-l:libfoo.a".
In cmComputeLinkInformation we construct regular expressions to
recognize library file names. This fixes the expressions to not allow a
colon (':') in the file name so that "-l:libfoo.a" is left alone.
Some AIX/gcc version combinations the <cstdio> header breaks when large
file support is enabled. See this GCC issue for details:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20366
We work around the problem by enhancing the configuration check for
large file support to include <cstdio> when available. This will cause
LFS to be disabled when the above problem occurs.
This extends the Fortran-to-C interface test to add a C++ source file.
The executable can only link with the C++ linker and with the proper
Fortran runtime libraries. These libraries should be detected by CMake
automatically, so this tests verifies the detection functionality.
This hack was created to help the Fortran test executables link to the
implicit C libraries added by BullsEye. Now that implicit libraries
from all languages are detected and included automatically the hack is
no longer needed.
This adds implicit libraries and search directories for languages linked
into a target other than the linker language to its link line. For
example, when linking an executable containing both C++ and Fortran code
the C++ linker is used but we need to add the Fortran libraries.
The variables
CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES
CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES
contain the implicit libraries and directories for each language.
Entries for the linker language are known to be implicit in the
generated link line. Entries for other languages that do not appear in
the known implicit set are listed explicitly at the end of the link
line.
This teaches the SystemInformation test to report the CMake log files
CMakeOutput.log and CMakeError.log from the CMake build tree and from
the SystemInformation test build tree. These logs may help diagnose
dashboard problems remotely.
This extends the Fortran/C interface test to require that the executable
link to the fortran language runtime libraries. We must verify that the
proper linker is chosen.